mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-31 07:12:39 -06:00
CodeEditor: #undef now highlighted
git-svn-id: svn://ultimatepp.org/upp/trunk@7714 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
fa63d8d1a6
commit
64fa3bfb72
2 changed files with 8 additions and 3 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue