#797 ifdef causing syntax highlight fail

closed-invalid
nobody
None
5
2012-11-06
2011-12-15
Anonymous
No

#ifdef __i386__
//any code here will be white background in black theme.
#endif
// now highlight works again

Discussion

  • Colomban Wendling

    You probably enabled the "lexer.cpp.track.preprocessor" lexer property in your filetypes.c and/or filetypes.cpp. This causes the highlighter to "gray out" preprocessor paths it thinks won't be taken. This is generally wrong, both because one generally want to have both path highlighted, and because the highlighter will only assume the test is true if *all* it's operand are correctly known at that moment (which means they have been defined explicitly previously in the same file), and evaluates to true.

    e.g.:

    #include <config.h>

    #define DEBUG
    #ifdef DEBUG
    this is highlighted, DEBUG is known to be defined
    #endif

    #if HAVE_SOMETHING
    this won't be highlighted, HAVE_SOMETHING isn't known and then is assumed to be false -- no matter what's in config.h or in the command-line that will build this file
    #endif

     
  • Colomban Wendling

    • status: open --> pending-invalid
     
  • Lex Trotman

    Lex Trotman - 2012-11-06

    Closed due to no response

     
  • Lex Trotman

    Lex Trotman - 2012-11-06
    • status: pending-invalid --> closed-invalid
     

Log in to post a comment.