From 561c83ef58eeb575e8dd3ad97958caea7aa09100 Mon Sep 17 00:00:00 2001 From: royqh1979 Date: Sat, 30 Oct 2021 19:58:13 +0800 Subject: [PATCH] - enhancement: correctly handle auto indents for multi-level embedding complex statements like 'for(...) if (...) printf(); --- NEWS.md | 2 ++ RedPandaIDE/qsynedit/highlighter/cpp.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 56318f2d..0e599635 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ Version 0.7.6 - change: don't auto insert a new line when input an enter between '(' and ')' or between '[' and ']' (indent instead) - enhancement: the line containing '}' will use the indents of the matching '{' line, instead of just unindent one level + - enhancement: the line containing 'public:' / 'private:' / 'protected:' / 'case *:' will use of indents of the surrounding '{' line, instead of just unindent one level + - enhancement: correctly handle auto indents for multi-level embedding complex statements like 'for(...) if (...) printf(); Version 0.7.5 - enhancement: more accurate auto indent calculation diff --git a/RedPandaIDE/qsynedit/highlighter/cpp.cpp b/RedPandaIDE/qsynedit/highlighter/cpp.cpp index 349c9987..226655d2 100644 --- a/RedPandaIDE/qsynedit/highlighter/cpp.cpp +++ b/RedPandaIDE/qsynedit/highlighter/cpp.cpp @@ -926,7 +926,7 @@ void SynEditCppHighlighter::semiColonProc() mExtTokenId = ExtTokenKind::SemiColon; if (mRange.state == RangeState::rsAsm) mRange.state = RangeState::rsUnknown; - if (mRange.getLastIndent() == sitStatement) { + while (mRange.getLastIndent() == sitStatement) { popIndents(sitStatement); } }