external mod. tracking, undo is possible after reloading

This commit is contained in:
Basile Burg 2015-03-11 01:06:31 +01:00
parent 413e4496b2
commit 8bd2898b75
1 changed files with 11 additions and 2 deletions

View File

@ -546,6 +546,7 @@ end;
procedure TCESynMemo.checkFileDate; procedure TCESynMemo.checkFileDate;
var var
newDate: double; newDate: double;
str: TStringList;
begin begin
if fFilename = fTempFileName then exit; if fFilename = fTempFileName then exit;
if not FileAge(fFilename, newDate) then exit; if not FileAge(fFilename, newDate) then exit;
@ -555,8 +556,16 @@ begin
if dlgOkCancel(format('"%s" has been modified by another program, load the new version ?', if dlgOkCancel(format('"%s" has been modified by another program, load the new version ?',
[shortenPath(fFilename, 25)])) = mrOk then [shortenPath(fFilename, 25)])) = mrOk then
begin begin
Lines.LoadFromFile(fFilename); str := TStringList.Create;
fModified := false; try
str.LoadFromFile(fFilename);
DoCopyToClipboard(str.Text);
ClearAll;
PasteFromClipboard;
fModified := true;
finally
str.Free;
end;
end; end;
end; end;
fFileDate := newDate; fFileDate := newDate;