mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-30 07:31:36 +00:00
Script Editor: fixed a problem where folded blocks were unfolded unexpectedly when the script was saved. Fixes #392
This commit is contained in:
parent
6917ded506
commit
6de1d10065
1 changed files with 11 additions and 9 deletions
|
@ -253,15 +253,17 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
editor.SelectionEnd = selectionEnd;
|
editor.SelectionEnd = selectionEnd;
|
||||||
editor.Scintilla.FirstVisibleLine = vscroll;
|
editor.Scintilla.FirstVisibleLine = vscroll;
|
||||||
|
|
||||||
// restore folding
|
// Restore folding
|
||||||
for (int i = 0; i < folded.Length; i++)
|
// Looks like that has to be done from back to front, as the end result will otherwise have too much unfolded for
|
||||||
{
|
// whatever reason. See https://github.com/jewalky/UltimateDoomBuilder/issues/392
|
||||||
Line l = editor.Scintilla.Lines[i];
|
for (int i = folded.Length - 1; i >= 0; i--)
|
||||||
l.FoldLevel = folded[i];
|
{
|
||||||
if (!expanded[i])
|
Line l = editor.Scintilla.Lines[i];
|
||||||
l.FoldLine(FoldAction.Contract);
|
l.FoldLevel = folded[i];
|
||||||
}
|
if (!expanded[i])
|
||||||
}
|
l.FoldLine(FoldAction.Contract);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This saves the document (used for both explicit and implicit)
|
// This saves the document (used for both explicit and implicit)
|
||||||
// Return true when successfully saved
|
// Return true when successfully saved
|
||||||
|
|
Loading…
Reference in a new issue