From 1fc76d50fbb1339cbfd8b77edb968bc4c028a19f Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Mon, 20 Sep 2021 20:30:09 +0800 Subject: [PATCH] change: add cppCommentEnd state in cpp highlighter --- RedPandaIDE/qsynedit/highlighter/cpp.cpp | 2 +- RedPandaIDE/qsynedit/highlighter/cpp.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/RedPandaIDE/qsynedit/highlighter/cpp.cpp b/RedPandaIDE/qsynedit/highlighter/cpp.cpp index 1defddf3..ab1bd21a 100644 --- a/RedPandaIDE/qsynedit/highlighter/cpp.cpp +++ b/RedPandaIDE/qsynedit/highlighter/cpp.cpp @@ -283,7 +283,7 @@ void SynEditCppHighlighter::ansiCppProc() } mRun+=1; } - mRange.state = RangeState::rsUnknown; + mRange.state = RangeState::rsCppCommentEnded; if (mLine[mRun-1] == '\\' && mLine[mRun]==0) { // continues on next line mRange.state = RangeState::rsCppComment; } diff --git a/RedPandaIDE/qsynedit/highlighter/cpp.h b/RedPandaIDE/qsynedit/highlighter/cpp.h index df4b517c..2da3ed34 100644 --- a/RedPandaIDE/qsynedit/highlighter/cpp.h +++ b/RedPandaIDE/qsynedit/highlighter/cpp.h @@ -44,7 +44,8 @@ class SynEditCppHighlighter: public SynHighlighter rsAsmBlock, rsDirective, rsDirectiveComment, rsString, rsMultiLineString, rsMultiLineDirective, rsCppComment, rsStringEscapeSeq, rsMultiLineStringEscapeSeq, - rsRawString, rsSpace,rsRawStringEscaping,rsRawStringNotEscaping,rsChar + rsRawString, rsSpace,rsRawStringEscaping,rsRawStringNotEscaping,rsChar, + rsCppCommentEnded }; public: