Skip to content
Snippets Groups Projects
Unverified Commit f693959d authored by Derek MacDonald's avatar Derek MacDonald Committed by GitHub
Browse files

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.
parent 6c8a3cb5
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment