Home Download Buy Blog Forum Support

#if defined and #endif coloring problem in C

#if defined and #endif coloring problem in C

Postby asomorjai on Fri Apr 13, 2012 12:19 pm

Hello folks,

The 2181 build seems to have a problem with coloring preprocessor statements. In the following snippet the words marked red are not colored correctly:

#if defined (__BEOS__)
# ifdef ZLIB_DLL
# ifdef ZLIB_INTERNAL
# define ZEXPORT __declspec(dllexport)
# define ZEXPORTVA __declspec(dllexport)
# else
# define ZEXPORT __declspec(dllimport)
# define ZEXPORTVA __declspec(dllimport)
# endif
# endif
#endif

Thanks,

Akos
asomorjai
 
Posts: 10
Joined: Fri Apr 13, 2012 12:15 pm

Re: #if defined and #endif coloring problem in C

Postby facelessuser on Fri Apr 13, 2012 1:54 pm

I code in C++ all day, so this was a problem for me as well. I created my own copy of the C++ language and fixed it here https://github.com/facelessuser/sublime ... tter%20C++

This will probably fix your issue. But this should also get fixed on the official one as well.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: #if defined and #endif coloring problem in C

Postby asomorjai on Mon Apr 16, 2012 11:36 am

Thanks, I'll give it a try.

Yes, it fixes the embedded endif, but doesn't fix the first defined.

Best, Akos
asomorjai
 
Posts: 10
Joined: Fri Apr 13, 2012 12:15 pm

Re: #if defined and #endif coloring problem in C

Postby facelessuser on Mon Apr 16, 2012 5:52 pm

asomorjai wrote:Thanks, I'll give it a try.

Yes, it fixes the embedded endif, but doesn't fix the first defined.

Best, Akos


I should say in my color scheme red is the same as #if and green is for the macro function.

Ahh, that is where we are at a difference of opinion. What are you expecting defined to be highlighted as, green? red? According to the rules, it is getting highlighted, or not not highlighted as expected. If you are expected green, I think that would be way wrong. I could see red, since it is a preprocessor directive. There just ins't a rule for it, but one could be added though.

You see, the #define macro() gets highlighted green because you are defining a macro. With #if, you are not highlighting a macro; defined() it is not a macro.
facelessuser
 
Posts: 1576
Joined: Tue Apr 05, 2011 7:38 pm

Re: #if defined and #endif coloring problem in C

Postby asomorjai on Thu Jun 21, 2012 9:51 am

facelessuser wrote:I code in C++ all day, so this was a problem for me as well. I created my own copy of the C++ language and fixed it here https://github.com/facelessuser/sublime ... tter%20C++

This will probably fix your issue. But this should also get fixed on the official one as well.


Thanks, I'll give it a try.

Best, Akos
asomorjai
 
Posts: 10
Joined: Fri Apr 13, 2012 12:15 pm


Return to Technical Support

Who is online

Users browsing this forum: Alexa [Bot], Orlmente and 24 guests