Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ward <matt.ward@microsoft.com>2018-08-02 17:34:45 +0300
committerMatt Ward <ward.matt@gmail.com>2018-08-03 18:24:07 +0300
commit4be95a750338db31d3acd8f1a4edefc70c385d26 (patch)
treee0f1555a483a279a0f50cac7c6b31215911fd79e
parent1024be32f41319914cfff2bc8edf399a351bc391 (diff)
[Ide] Fix autosave not loading autosaved filemonodevelop-7.7.0.805
With unsaved changes in the text editor, and the IDE crashes, on re-starting the IDE, and opening the solution containing the file that was unsaved, the editor was not showing the 'An autosave file has been found for this file' message in the text editor. Instead the text editor was showing a message saying that the file had been changed outside the IDE. The Keep Changes button if clicked would result in an empty file in the text editor and the file changes would be lost. The problem was that on loading the file with an associated autosave file the last write time was being updated which caused the file watcher to raise a file changed event. This then caused the autosave message to be replaced with the file has been changed outside the IDE message. The SdiWorkspaceWindow's SetTitleEvent method would change the last write time of the file if the text editor view indicated it was dirty. To avoid this when an SdiWorkspaceWindow is created, either on opening a file, or by docking the text editor view side by side in the IDE, the SetTitleEvent now does not change the file's last write time. Fixes VSTS #656105 - Autosave does not load autosaved file
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs11
1 files changed, 8 insertions, 3 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs
index b2585748d3..c08801ef9d 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Gui/SdiWorkspaceWindow.cs
@@ -84,7 +84,7 @@ namespace MonoDevelop.Ide.Gui
{
this.tabControl = tabControl;
this.tab = tabLabel;
- SetTitleEvent(null, null);
+ SetTitleEvent (false);
SetDockNotebookTabTitle ();
}
@@ -114,7 +114,7 @@ namespace MonoDevelop.Ide.Gui
box.Show ();
Add (box);
- SetTitleEvent(null, null);
+ SetTitleEvent (false);
}
internal void CreateCommandHandler ()
@@ -441,6 +441,11 @@ namespace MonoDevelop.Ide.Gui
public void SetTitleEvent(object sender, EventArgs e)
{
+ SetTitleEvent ();
+ }
+
+ void SetTitleEvent(bool allowMarkFileDirty = true)
+ {
if (content == null)
return;
@@ -473,7 +478,7 @@ namespace MonoDevelop.Ide.Gui
}
if (content.IsDirty) {
- if (!String.IsNullOrEmpty (content.ContentName))
+ if (allowMarkFileDirty && !String.IsNullOrEmpty (content.ContentName))
IdeApp.ProjectOperations.MarkFileDirty (content.ContentName);
} else if (content.IsReadOnly) {
newTitle += "+";