News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

syntax highlight

Started by linsys, May 04, 2015, 03:46:29 PM

Previous topic - Next topic

linsys

Hello,

I've found a strange behavior in syntax highlight related to
WIN32, _WIN32, __WIN32, __WIN32__ symbols, it appear as if they
are always defined but only in syntax highlight.

I've attached a captured image to better explain

Best Regards

linsys

well after same more testing it come out that in:

Settings->editor->C/C++ Editor settings

options:

- Collect defines from project file
- Include host platform defines

changes this behavior, but not in the expected way:

it appear as if definitions from host and project have
precedence over definitions in local file



linsys

ok got it, the collector collect
all #define but not the #undef
like in the following example

#define T1
#undef T1

#if defined T1
   #warning "defined"
   #define TEST() printf("defined")
#else
   #warning "not defined"
   #define TEST() printf("not defined")
#endif

int main()
{
   TEST();
   return 0;
}

oBFusCATed

As you've already found this is a pretty basic feature by design and also it is implemented in our editor component which is provided by the Scintilla project.
The only thing we can do is implement our own semantic highlight, but no one has done it yet, unfortunately.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

linsys

as you pointed also SciTE suffer of this bug, it appear that exist a two year old lexUndef.patch
I will investigate furter.
thank you