diff options
-rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
-rw-r--r-- | src/Editor.cxx | 7 |
2 files changed, 8 insertions, 3 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index b7d4b1e5b..066e18af0 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -581,6 +581,10 @@ Released 31 March 2022. </li> <li> + Improve performance of SCI_FOLDALL(SC_FOLDACTION_EXPAND) by not lexing whole document + as it does not depend on folding structure. + </li> + <li> Fix partial updates and non-responsive scroll bars on Xorg. This defers scroll bar changes to an idle task so could affect applications that depend on the scroll position being updated. diff --git a/src/Editor.cxx b/src/Editor.cxx index 6ff0f2d97..387194fe3 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5529,9 +5529,11 @@ void Editor::EnsureLineVisible(Sci::Line lineDoc, bool enforcePolicy) { } void Editor::FoldAll(FoldAction action) { - pdoc->EnsureStyledTo(pdoc->Length()); const Sci::Line maxLine = pdoc->LinesTotal(); bool expanding = action == FoldAction::Expand; + if (!expanding) { + pdoc->EnsureStyledTo(pdoc->Length()); + } if (action == FoldAction::Toggle) { // Discover current state for (int lineSeek = 0; lineSeek < maxLine; lineSeek++) { @@ -5544,8 +5546,7 @@ void Editor::FoldAll(FoldAction action) { if (expanding) { pcs->SetVisible(0, maxLine-1, true); for (int line = 0; line < maxLine; line++) { - const FoldLevel levelLine = pdoc->GetFoldLevel(line); - if (LevelIsHeader(levelLine)) { + if (!pcs->GetExpanded(line)) { SetFoldExpanded(line, true); } } |