Fixed: saving a script would reset scrolling to the top

This commit is contained in:
ZZYZX 2017-02-26 12:03:39 +02:00
parent 39889a94d1
commit 6661ed44e3
3 changed files with 5 additions and 3 deletions

View file

@ -208,6 +208,7 @@ namespace CodeImp.DoomBuilder.Controls
protected void RemoveTrailingWhitespace()
{
// after changing the contents, selection should stay on the same line, and just move to the end of that line if it was on the trailing space.
int vscroll = editor.Scintilla.FirstVisibleLine;
int selectionStart = editor.SelectionStart;
int selectionEnd = editor.SelectionEnd;
@ -240,6 +241,7 @@ namespace CodeImp.DoomBuilder.Controls
editor.Text = string.Join("\n", atext);
editor.SelectionStart = selectionStart;
editor.SelectionEnd = selectionEnd;
editor.Scintilla.FirstVisibleLine = vscroll;
}
// This saves the document (used for both explicit and implicit)

View file

@ -30,6 +30,6 @@ using CodeImp.DoomBuilder;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.2918")]
[assembly: AssemblyVersion("2.3.0.2920")]
[assembly: NeutralResourcesLanguageAttribute("en")]
[assembly: AssemblyHash("2bb2c92")]
[assembly: AssemblyHash("39889a9")]

View file

@ -29,5 +29,5 @@ using System.Resources;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.3.0.2918")]
[assembly: AssemblyVersion("2.3.0.2920")]
[assembly: NeutralResourcesLanguageAttribute("en")]