diff --git a/NEWS.md b/NEWS.md index a818a7aa..e6cc19d6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,7 @@ Version 0.11.3 For Dev-C++ 7 Beta - fix: use pixel size for fonts, to fit different dpi in multiple displays - enhancement: use the new expression parser to parse info for tips + - enhancement: better highlight processing for preprocess directives Version 0.11.2 For Dev-C++ 7 Beta - fix: button "run all problem cases" not disabled when compiling or debugging diff --git a/RedPandaIDE/qsynedit/highlighter/cpp.cpp b/RedPandaIDE/qsynedit/highlighter/cpp.cpp index 28ff75fe..4a5d712c 100644 --- a/RedPandaIDE/qsynedit/highlighter/cpp.cpp +++ b/RedPandaIDE/qsynedit/highlighter/cpp.cpp @@ -420,28 +420,38 @@ void SynEditCppHighlighter::directiveProc() return; } mTokenId = TokenKind::Directive; - do { - switch(mLine[mRun].unicode()) { - case '/': //comment? - switch (mLine[mRun+1].unicode()) { - case '/': // is end of directive as well - mRange.state = RangeState::rsUnknown; - return; - case '*': // might be embeded only - mRange.state = RangeState::rsDirectiveComment; - return; - } - break; - case '\\': // yet another line? - if (mLine[mRun+1] == 0) { - mRun+=1; - mRange.state = RangeState::rsMultiLineDirective; - return; - } - break; - } + mRun+=1; + //skip spaces + while (mLine[mRun]!=0 && isSpaceChar(mLine[mRun])) { mRun+=1; - } while (mLine[mRun]!=0); + } + + while (mLine[mRun]!=0 && isIdentChar(mLine[mRun])) { + mRun+=1; + } + mRange.state = RangeState::rsUnknown; +// do { +// switch(mLine[mRun].unicode()) { +// case '/': //comment? +// switch (mLine[mRun+1].unicode()) { +// case '/': // is end of directive as well +// mRange.state = RangeState::rsUnknown; +// return; +// case '*': // might be embeded only +// mRange.state = RangeState::rsDirectiveComment; +// return; +// } +// break; +// case '\\': // yet another line? +// if (mLine[mRun+1] == 0) { +// mRun+=1; +// mRange.state = RangeState::rsMultiLineDirective; +// return; +// } +// break; +// } +// mRun+=1; +// } while (mLine[mRun]!=0); } void SynEditCppHighlighter::directiveEndProc()