CodeEditor: #undef now highlighted

git-svn-id: svn://ultimatepp.org/upp/trunk@7714 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-09-21 16:26:00 +00:00
parent fa63d8d1a6
commit 64fa3bfb72
2 changed files with 8 additions and 3 deletions

View file

@ -70,6 +70,12 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
int linelen = int(e - ltext);
const wchar *p = ltext;
for(const wchar *ms = p; ms < e; ms++)
if(*ms != ' ' && *ms != '\t') {
macro = macro || *ms == '#';
break;
}
Grounding(p, e);
if(highlight == HIGHLIGHT_CALC) {
if(editor && line == editor->GetLineCount() - 1 || *p == '$')
@ -315,8 +321,7 @@ void CSyntax::Highlight(const wchar *ltext, const wchar *e, HighlightOutput& hls
if(lbrace < 0 && lbclose >= 0)
hls.SetPaper(lbclose, linelen + 1 - lbclose, lbcolor);
}
if(!IsNull(cppid) && (cppid == "else" || cppid == "elif" || cppid == "endif" || cppid == "if"
|| cppid == "ifdef" || cppid == "ifndef"))
if(findarg(cppid, "else", "elif", "endif", "if", "ifdef", "ifndef") >= 0)
hls.SetPaper(0, hls.v.GetCount(), hl_style[PAPER_IFDEF].color);
}

View file

@ -34,7 +34,7 @@ HL_COLOR(PAPER_BLOCK3, t_("Block level 3"), 0)
HL_COLOR(PAPER_BLOCK4, t_("Block level 4"), 0)
HL_COLOR(INK_MACRO, t_("#preprocesor text"), 1)
HL_COLOR(PAPER_MACRO, t_("#define background"), 0)
HL_COLOR(PAPER_MACRO, t_("#define/#undef/#pragma background"), 0)
HL_COLOR(PAPER_IFDEF, t_("#if/#else/#endif background"), 0)
HL_COLOR(INK_IFDEF, t_("#if/#else/#endif comment"), 1)