fix editor temp filename was considered as a valid filename

This commit is contained in:
Basile Burg 2014-08-18 08:32:47 +02:00
parent 094a7d7ece
commit da52e21153
1 changed files with 6 additions and 3 deletions

View File

@ -1045,12 +1045,15 @@ end;
procedure TCEMainForm.actFileSaveExecute(Sender: TObject); procedure TCEMainForm.actFileSaveExecute(Sender: TObject);
var var
str: string; str: string;
ed: TCESynMemo;
begin begin
if fEditWidg = nil then exit; if fEditWidg = nil then exit;
if fEditWidg.editorIndex < 0 then exit; ed := fEditWidg.currentEditor;
if ed = nil then exit;
// //
str := fEditWidg.editor[fEditWidg.editorIndex].fileName; str := ed.fileName;
if fileExists(str) then saveFile(fEditWidg.editorIndex) if (str <> ed.tempFilename) and (fileExists(str)) then
saveFile(fEditWidg.editorIndex)
else actFileSaveAs.Execute; else actFileSaveAs.Execute;
end; end;