Author Topic: #if 0 inactive code  (Read 363 times)

joecar

  • Senior Community Member
  • Posts: 260
  • Hero Points: 9
  • engineer/gearhead
#if 0 inactive code
« on: February 07, 2020, 04:54:21 pm »
I can't get #if 0 code slabs to color as inactive code... what did I miss...?

Thanks.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2891
  • Hero Points: 436
Re: #if 0 inactive code
« Reply #1 on: February 07, 2020, 07:03:32 pm »
Do you have the feature disabled?  Document > C/C++ Options... > Color Coding > Language > |x| Color Inactive...

Have you changed your color scheme?  Double-check that the inactive code colors have a background that you can clearly see.  Tools > Options > Appearance > Colors > Comments > Inactive*

Are you looking for this to work in a language that does not have built-in C-Preprocessing support?  What language are we dealing with here?

If none of the above are the problem, could you post some sample code?

joecar

  • Senior Community Member
  • Posts: 260
  • Hero Points: 9
  • engineer/gearhead
Re: #if 0 inactive code
« Reply #2 on: February 07, 2020, 11:03:17 pm »
C code.

I have not changed to color scheme.

See attached pics.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2891
  • Hero Points: 436
Re: #if 0 inactive code
« Reply #3 on: February 07, 2020, 11:09:09 pm »
Only thing I can guess is that your code is actually in ANSI-C mode, so you might want to check those options.

Also, if you have changed to color coding in any manner so that #if is not detected as a preprocessing directive, that would break things too.

I would suggest trying this with is shiny new configuration to make sure the problem is not in your configuration.

Code: [Select]
vs +new -sc /tmp/shinynewconfig

Graeme

  • Senior Community Member
  • Posts: 2422
  • Hero Points: 320
Re: #if 0 inactive code
« Reply #4 on: February 08, 2020, 07:54:23 am »
I can't get #if 0 code slabs to color as inactive code... what did I miss...?

Thanks.
In the Document menu -> select mode(...)    - what mode is shown.
Did you install a new version just before the problem started?
Does the problem appear in more than one file?
With slick closed, try deleting vslick.sta.


joecar

  • Senior Community Member
  • Posts: 260
  • Hero Points: 9
  • engineer/gearhead
Re: #if 0 inactive code
« Reply #5 on: February 13, 2020, 08:56:13 pm »
Document->Select Mode (C/C++)

I did change the color for block matching highlighting.

Problem appears for all open C/C++ files.
« Last Edit: February 13, 2020, 08:59:13 pm by joecar »

joecar

  • Senior Community Member
  • Posts: 260
  • Hero Points: 9
  • engineer/gearhead
Re: #if 0 inactive code
« Reply #6 on: February 13, 2020, 08:58:19 pm »
I deleted vslick.sta and inactive coloring still does not go.

joecar

  • Senior Community Member
  • Posts: 260
  • Hero Points: 9
  • engineer/gearhead
Re: #if 0 inactive code
« Reply #7 on: February 13, 2020, 09:02:13 pm »
Code: [Select]
vs +new -sc /tmp/shinynewconfig
Doing this, inactive color shows up ok.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2891
  • Hero Points: 436
Re: #if 0 inactive code
« Reply #8 on: February 14, 2020, 12:56:12 am »
That would mean the issue is in your configuration, either colors, or color coding.  I'll take a look at your user.cfg.xml if you attach it and see where the problem is.

joecar

  • Senior Community Member
  • Posts: 260
  • Hero Points: 9
  • engineer/gearhead
Re: #if 0 inactive code
« Reply #9 on: February 14, 2020, 04:29:34 pm »
See attached, thanks.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2891
  • Hero Points: 436
Re: #if 0 inactive code
« Reply #10 on: February 14, 2020, 06:34:22 pm »
Uncheck Document > C/C++ Options... > Color Coding > Langauge > Preprocessing keywords can appear anywhere

This has an undesirable interaction with inactive code regions coloring.  Should not be a problem because C++ preprocessing can't just be anywhere, it has to be the first non-blank character.

I'll check into the interaction, because it should not break the normal case for coloring inactive code, but that fix would have to go in the next release, not hot-fixable.

joecar

  • Senior Community Member
  • Posts: 260
  • Hero Points: 9
  • engineer/gearhead
Re: #if 0 inactive code
« Reply #11 on: February 14, 2020, 09:20:26 pm »
Ok, I unchecked that and inactive coloring on #if 0 is fixed.

Thanks, appreciate all your help.

Dennis

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2891
  • Hero Points: 436
Re: #if 0 inactive code
« Reply #12 on: February 17, 2020, 03:28:45 pm »
Just for curiosity's sake, was there a particular reason you had enabled that option?

joecar

  • Senior Community Member
  • Posts: 260
  • Hero Points: 9
  • engineer/gearhead
Re: #if 0 inactive code
« Reply #13 on: February 17, 2020, 03:36:22 pm »
I'm not sure why/how that got checked in the first place.
« Last Edit: February 17, 2020, 03:40:37 pm by joecar »