SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => SlickEdit® Core for Eclipse™ => Topic started by: jechard on November 17, 2010, 09:14:23 pm

Title: Adaptive Formatting Default
Post by: jechard 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.
Title: Re: Adaptive Formatting Default
Post by: hs2 on November 17, 2010, 10:19:02 pm
Have a look at this (http://community.slickedit.com/index.php?topic=2540.msg10515#msg10515) method.
Hope it helps. Good luck !
HS2
Title: Re: Adaptive Formatting Default
Post by: jechard 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);
}