Skip to content

Commit f6a2727

Browse files
committed
Restore document scroll state also...
1 parent 5736612 commit f6a2727

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

FlashDevelop/Managers/FileStateManager.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ private static void ApplyStateObject(ScintillaControl sci, StateObject so, Boole
123123
}
124124
if (restorePosition)
125125
{
126+
sci.FirstVisibleLine = so.LineScroll;
126127
Int32 line = sci.LineFromPosition(so.Position);
127128
sci.SetSel(so.Position, so.Position);
128129
sci.EnsureVisible(line);
@@ -138,6 +139,7 @@ private static StateObject GetStateObject(ScintillaControl sci)
138139
so.LineCount = sci.LineCount;
139140
so.Position = sci.CurrentPos;
140141
so.FileName = sci.FileName;
142+
so.LineScroll = sci.FirstVisibleLine;
141143
for (Int32 line = 0;; line++)
142144
{
143145
Int32 lineNext = sci.ContractedFoldNext(line);
@@ -168,6 +170,7 @@ public class StateObject
168170
{
169171
public Int32 Position = 0;
170172
public Int32 LineCount = 0;
173+
public Int32 LineScroll = 0;
171174
public String FileName = String.Empty;
172175
public List<Int32> BookmarkedLines = new List<Int32>();
173176
public List<Int32> FoldedLines = new List<Int32>();

0 commit comments

Comments
 (0)