Author Topic: Adaptive Formatting Default  (Read 4094 times)

jechard

  • Community Member
  • Posts: 15
  • Hero Points: 0
Adaptive Formatting Default
« on: November 17, 2010, 09:14:23 pm »
Is there a way to turn adaptive formatting on by default for certain files rather than toggling it manually each time a file is opened? 

For example, I would like to have all c, cpp and h files fold on the parens whenever it is opened.  I've created a macro that I can run manually that will do this via a hotkey, but would like to skip that last step and have it happen automatically for the mentioned file types.  Just wondering if there is some event handler I could over-ride or callback, or where in the slick-c code I might put this sort of behavior.

hs2

  • Senior Community Member
  • Posts: 2738
  • Hero Points: 288
Re: Adaptive Formatting Default
« Reply #1 on: November 17, 2010, 10:19:02 pm »
Have a look at this method.
Hope it helps. Good luck !
HS2

jechard

  • Community Member
  • Posts: 15
  • Hero Points: 0
Re: Adaptive Formatting Default
« Reply #2 on: November 18, 2010, 12:29:39 pm »
HS2, perfect, exactly what I was looking for.  If anyones interested, this is what I did:


int userSelectEditMode(_str origExt, boolean origBypassBufferSetup)
{
//   say ("userSelectEditMode: bname:" p_buf_name " stripped:" strip_filename( p_buf_name, 'PDN' ));
   if(_bufname2ext(p_buf_name) == 'c') {
      show_braces();
      expand_all();
   }
   return (1);
}