Skip to content

Commit fcf1b1c

Browse files
committed
Improvements to FilePollManager...
1 parent 957b8f2 commit fcf1b1c

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

FlashDevelop/Docking/TabbedDocument.cs

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,15 +345,22 @@ public Boolean CheckFileChange()
345345
if (!Globals.MainForm.ClosingEntirely && File.Exists(this.FileName))
346346
{
347347
FileInfo fi = new FileInfo(this.FileName);
348-
if (this.fileInfo.LastWriteTime != fi.LastWriteTime)
349-
{
350-
this.fileInfo = fi;
351-
return true;
352-
}
348+
if (this.fileInfo.LastWriteTime != fi.LastWriteTime) return true;
353349
}
354350
return false;
355351
}
356352

353+
/// <summary>
354+
/// Updates the file info after user dismisses the change notification
355+
/// </summary>
356+
public void RefreshFileInfo()
357+
{
358+
if (!Globals.MainForm.ClosingEntirely && File.Exists(this.FileName))
359+
{
360+
this.fileInfo = new FileInfo(this.FileName);
361+
}
362+
}
363+
357364
/// <summary>
358365
/// Saves an editable document
359366
/// </summary>

FlashDevelop/Managers/FilePollManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ private static void CheckFileChange(ITabbedDocument document)
5858
MessageBoxManager.Cancel = TextHelper.GetString("Label.YesToAll");
5959
MessageBoxManager.Register(); // Use custom labels...
6060
DialogResult result = MessageBox.Show(Globals.MainForm, formatted, " " + dlgTitle, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Information);
61+
casted.RefreshFileInfo(); // User may have waited before responding, save info now
6162
if (result == DialogResult.Yes) casted.Reload(false);
6263
else if (result == DialogResult.Cancel)
6364
{

0 commit comments

Comments
 (0)