From 6661ed44e3db7a4b912383d534ce992749cdd4f8 Mon Sep 17 00:00:00 2001 From: ZZYZX Date: Sun, 26 Feb 2017 12:03:39 +0200 Subject: [PATCH] Fixed: saving a script would reset scrolling to the top --- Source/Core/Controls/Scripting/ScriptDocumentTab.cs | 2 ++ Source/Core/Properties/AssemblyInfo.cs | 4 ++-- Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Source/Core/Controls/Scripting/ScriptDocumentTab.cs b/Source/Core/Controls/Scripting/ScriptDocumentTab.cs index 33bd105c..20307811 100755 --- a/Source/Core/Controls/Scripting/ScriptDocumentTab.cs +++ b/Source/Core/Controls/Scripting/ScriptDocumentTab.cs @@ -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) diff --git a/Source/Core/Properties/AssemblyInfo.cs b/Source/Core/Properties/AssemblyInfo.cs index 886c3179..7bc5f344 100755 --- a/Source/Core/Properties/AssemblyInfo.cs +++ b/Source/Core/Properties/AssemblyInfo.cs @@ -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")] diff --git a/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs b/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs index fdebd0ab..81bc70f2 100755 --- a/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs +++ b/Source/Plugins/BuilderModes/Properties/AssemblyInfo.cs @@ -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")]