From e50a8d0faf93b2b929ef06eb30f39184e6b78818 Mon Sep 17 00:00:00 2001 From: "royqh1979@gmail.com" Date: Tue, 12 Oct 2021 20:45:26 +0800 Subject: [PATCH] correctly update old matching brackets --- RedPandaIDE/editor.cpp | 2 ++ RedPandaIDE/qsynedit/TextPainter.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/RedPandaIDE/editor.cpp b/RedPandaIDE/editor.cpp index 4e37d444..b3999970 100644 --- a/RedPandaIDE/editor.cpp +++ b/RedPandaIDE/editor.cpp @@ -1326,6 +1326,8 @@ void Editor::onStatusChanged(SynStatusChanges changes) if (changes.testFlag(SynStatusChange::scCaretX) || changes.testFlag(SynStatusChange::scCaretY)) { + invalidateLine(mHighlightCharPos1.Line); + invalidateLine(mHighlightCharPos2.Line); mHighlightCharPos1 = BufferCoord{0,0}; mHighlightCharPos2 = BufferCoord{0,0}; if (mTabStopBegin >=0) { diff --git a/RedPandaIDE/qsynedit/TextPainter.cpp b/RedPandaIDE/qsynedit/TextPainter.cpp index d80fb66e..8caa3364 100644 --- a/RedPandaIDE/qsynedit/TextPainter.cpp +++ b/RedPandaIDE/qsynedit/TextPainter.cpp @@ -668,7 +668,7 @@ void SynEditTextPainter::PaintFoldAttributes() } // Get next nonblank line LastNonBlank = vLine - 1; - while (LastNonBlank + 1 < edit->mLines->count() && edit->mLines->getString(LastNonBlank).trimmed().isEmpty()) + while (LastNonBlank + 1 < edit->mLines->count() && edit->mLines->getString(LastNonBlank).isEmpty()) LastNonBlank++; LineIndent = edit->getLineIndent(edit->mLines->getString(LastNonBlank)); int braceLevel = edit->mLines->ranges(LastNonBlank).braceLevel;