optimize the speed for editing big source file

This commit is contained in:
Roy Qu 2024-05-07 20:54:40 +08:00
parent 30e7751abf
commit 7b0b0587cd
1 changed files with 6 additions and 1 deletions

View File

@ -3293,10 +3293,15 @@ int QSynEdit::reparseLines(int startLine, int endLine)
} }
mDocument->setSyntaxState(line,state); mDocument->setSyntaxState(line,state);
line++; 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) if (mEditingCount>0)
return line; return line;
if (useCodeFolding()) if (useCodeFolding())
rescanFolds(); rescanFolds();
return line; return line;