diff --git a/src/ce_main.pas b/src/ce_main.pas index 70145265..2c17c6ca 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -1045,12 +1045,15 @@ end; procedure TCEMainForm.actFileSaveExecute(Sender: TObject); var str: string; + ed: TCESynMemo; begin 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; - if fileExists(str) then saveFile(fEditWidg.editorIndex) + str := ed.fileName; + if (str <> ed.tempFilename) and (fileExists(str)) then + saveFile(fEditWidg.editorIndex) else actFileSaveAs.Execute; end;