diff options
| author | Neil <nyamatongwe@gmail.com> | 2022-05-10 12:19:52 +1000 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2022-05-10 12:19:52 +1000 | 
| commit | f82a2c25a5805d0dab5cd66ef221eb247bc36134 (patch) | |
| tree | 8012b8437d7e503626ac06b62fb3f6a9c475df92 /src | |
| parent | 4e556e4aaba49f4307ab4933a376e0c34d0be674 (diff) | |
| download | scintilla-mirror-f82a2c25a5805d0dab5cd66ef221eb247bc36134.tar.gz | |
Improve performance of SCI_FOLDALL(SC_FOLDACTION_EXPAND).
Diffstat (limited to 'src')
| -rw-r--r-- | src/Editor.cxx | 7 | 
1 files changed, 4 insertions, 3 deletions
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);  			}  		}  | 
