From 52e859756b19afebce1b833cea8f6f1c8db1a146 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Wed, 6 Mar 2024 17:27:44 +0800 Subject: [PATCH] fix: string not correctly syntax parsed. --- libs/qsynedit/qsynedit/syntaxer/cpp.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libs/qsynedit/qsynedit/syntaxer/cpp.cpp b/libs/qsynedit/qsynedit/syntaxer/cpp.cpp index 602cae6e..fbc115bf 100644 --- a/libs/qsynedit/qsynedit/syntaxer/cpp.cpp +++ b/libs/qsynedit/qsynedit/syntaxer/cpp.cpp @@ -1300,7 +1300,8 @@ void CppSyntaxer::procString() while (mRun < mLineSize) { if (mLine[mRun]=='"') { mRun++; - break; + mRange.state = RangeState::rsUnknown; + return; } else if (mLine[mRun]==' ' || mLine[mRun]=='\t') { return; } else if (mLine[mRun]=='\\') { @@ -1342,10 +1343,8 @@ void CppSyntaxer::procString() } mRun+=1; } - if (mRun>=mLineSize) - mRange.state = RangeState::rsStringUnfinished; - else - mRange.state = RangeState::rsUnknown; + // here mRun>=mLineSize + mRange.state = RangeState::rsStringUnfinished; } void CppSyntaxer::procStringStart()