diff options
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);  			}  		} | 
