diff --git a/NEWS.md b/NEWS.md index 3b3f52d7..1f620bd8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ Red Panda C++ Version 2.20 - fix: Projects created by some templates are not correct when editor's default encoding is not utf8. - fix: File/Project visit histories are not correctly saved when clearing. - change: Default max function frame size is 2MB under windows / 8MB others. + - fix: Octal numeric escape sequences is not correctly syntax highlighted. Red Panda C++ Version 2.19 diff --git a/libs/qsynedit/qsynedit/syntaxer/cpp.cpp b/libs/qsynedit/qsynedit/syntaxer/cpp.cpp index 41882f79..5080d909 100644 --- a/libs/qsynedit/qsynedit/syntaxer/cpp.cpp +++ b/libs/qsynedit/qsynedit/syntaxer/cpp.cpp @@ -1177,7 +1177,13 @@ void CppSyntaxer::procStringEscapeSeq() case '5': case '6': case '7': - mRun+=3; + for (int i=0;i<3;i++) { + if (mRun>=mLineSize || + (mLine[mRun]<'0' || mLine[mRun]>'7') + ) + break; + mRun+=1; + } break; case '8': case '9': @@ -1194,6 +1200,14 @@ void CppSyntaxer::procStringEscapeSeq() mRun+=1; } break; + case 'o': + mRun+=1; + while (mRun='0' && mLine[mRun]<='7') + )) { + mRun+=1; + } + break; case 'u': mRun+=5; break;