mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-26 22:01:45 +00:00
Unchanged script editor skips implicit save (#543)
Stop calling ScriptFileDocumentTab.RemoveTrailingWhitespace() on a text editor that has unchanged text. This causes the currently-opened map to be marked 'isChanged == true' when nothing is modified.
This commit is contained in:
parent
6c8a3cb50b
commit
f693959df4
2 changed files with 5 additions and 1 deletions
|
@ -73,6 +73,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
{
|
||||
editor.SetText(stream.ToArray()); //mxd
|
||||
editor.ClearUndoRedo();
|
||||
editor.SetSavePoint();
|
||||
}
|
||||
|
||||
// Set title
|
||||
|
@ -108,6 +109,8 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Implicit save
|
||||
public override bool Save()
|
||||
{
|
||||
if (!editor.IsChanged) return false;
|
||||
|
||||
// [ZZ] remove trailing whitespace
|
||||
RemoveTrailingWhitespace();
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
editor.SetText(stream.ToArray());
|
||||
editor.Scintilla.ReadOnly = source.IsReadOnly;
|
||||
editor.ClearUndoRedo();
|
||||
editor.SetSavePoint();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -92,7 +93,7 @@ namespace CodeImp.DoomBuilder.Controls
|
|||
// Return true when successfully saved
|
||||
public override bool Save()
|
||||
{
|
||||
if(source.IsReadOnly) return false;
|
||||
if(source.IsReadOnly || !editor.IsChanged) return false;
|
||||
|
||||
// [ZZ] remove trailing whitespace
|
||||
RemoveTrailingWhitespace();
|
||||
|
|
Loading…
Reference in a new issue