Skip to content

Commit 5fd1304

Browse files
committed
Fix only first fold is preserved when updating foldings (resolves issue #86)
1 parent ec27566 commit 5fd1304

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ICSharpCode.AvalonEdit/Folding/FoldingManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,12 +279,12 @@ public void UpdateFoldings(IEnumerable<NewFolding> newFoldings, int firstErrorOf
279279
// auto-close #regions only when opening the document
280280
if (isFirstUpdate) {
281281
section.IsFolded = newFolding.DefaultClosed;
282-
isFirstUpdate = false;
283282
}
284283
section.Tag = newFolding;
285284
}
286285
section.Title = newFolding.Name;
287286
}
287+
isFirstUpdate = false;
288288
// remove all outstanding old foldings:
289289
while (oldFoldingIndex < oldFoldings.Length) {
290290
FoldingSection oldSection = oldFoldings[oldFoldingIndex++];

0 commit comments

Comments
 (0)