From 7b0b0587cd027aa207f9658c12cb69bfcd639135 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Tue, 7 May 2024 20:54:40 +0800 Subject: [PATCH] optimize the speed for editing big source file --- libs/qsynedit/qsynedit/qsynedit.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libs/qsynedit/qsynedit/qsynedit.cpp b/libs/qsynedit/qsynedit/qsynedit.cpp index 278de51b..8f2690c2 100644 --- a/libs/qsynedit/qsynedit/qsynedit.cpp +++ b/libs/qsynedit/qsynedit/qsynedit.cpp @@ -3293,10 +3293,15 @@ int QSynEdit::reparseLines(int startLine, int endLine) } mDocument->setSyntaxState(line,state); line++; - } while (line < endLine); + } while (line < mDocument->count()); + + //don't rescan folds if only currentLine is reparsed + if (line-startLine==1) + return line; if (mEditingCount>0) return line; + if (useCodeFolding()) rescanFolds(); return line;