Author Topic: Reload open buffers after changing preprocessor definitions  (Read 6594 times)

jechard

  • Community Member
  • Posts: 15
  • Hero Points: 0
Reload open buffers after changing preprocessor definitions
« on: December 08, 2010, 07:08:13 PM »
Anyone know of a way to force the open buffers to reload after changing the preprocessor definitions?  For instance, define or undef a variable that would result in "inactive" code blocks within the current buffers.  However, to make that take affect, the buffer needs to be closed and then opened again.  Just wondering if there is a hook that I can over-ride to add the functionality, or even just a call I can make that will quickly reload the buffers so that I don't have to close and manually locate and reopen the buffers each time I do this.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Reload open buffers after changing preprocessor definitions
« Reply #1 on: December 09, 2010, 11:47:25 AM »
What version of slickedit are you using?  If you change a preprocessor definition, slick should retag your workspace automatically - I have an idea it didn't always do that (in a previous version of slick).  If it doesn't you can ask it to  - in tools -> tag files, select the workspace tag file and click rebuild.

You can probably write a macro to reload all open buffers but I'm not sure why you need to.  In the project menu, you can close your workspace and re-open it but I'm not sure that will help.

Graeme

jechard

  • Community Member
  • Posts: 15
  • Hero Points: 0
Re: Reload open buffers after changing preprocessor definitions
« Reply #2 on: December 09, 2010, 07:04:56 PM »
Slick edit core 3.6.1.  It will retag my workspace automatically, which sometimes I choose to wait until later for.  However, even with a retag, the preprocessor definitions do not show up in open buffers until they are reloaded.  I assume this is because there is some specific color processing that happens when the buffer is opened for "inactive" code blocks.  I'm sure there is a way to write a macro as well that will do this, I just can't find the correct hook that will force the buffer to reload.  This is strictly so I can make quick adjustments to my preprocessor definitions and see the changes instantly.  Clearly closing the workspace or reopening the file works, but I'm looking for fast, that's what I love about slick edit, and why I use it.

Graeme

  • Senior Community Member
  • Posts: 2796
  • Hero Points: 347
Re: Reload open buffers after changing preprocessor definitions
« Reply #3 on: December 10, 2010, 11:41:23 AM »
oops, didn't notice this was the core for eclipse forum.

It's probably possible to write a macro to reload all files but I'm guessing you shouldn't need to so maybe you could try reporting to slickedit support in case it's a bug.

Also, I wasn't aware that you can create inactive code regions using #ifdef - I thought it was just #if 0  ??

Graeme

jechard

  • Community Member
  • Posts: 15
  • Hero Points: 0
Re: Reload open buffers after changing preprocessor definitions
« Reply #4 on: December 10, 2010, 01:54:09 PM »
Graeme,

It always used to be #if 0, you'll notice I've got another post about that in this same forum:)  However, the latest core (which is based off SlickEdit 2010) does include this functionality, and it works quite well.  Now you can put your preprocessors in and you don't have to use selective display, it will gray the text out, and although I haven't verified I believe it honors it in the tag files as well.  Fantastic improvement to an otherwise fantastic tool, this is really just a nit.  I'll send an email to the support team, and if I come to any resolution will respond here.  Thanks for your help.