Auto save Python script file

This commit is contained in:
Nathan Woodrow 2013-07-22 08:48:45 +10:00
parent ed286eb198
commit d0d2511d13

View File

@ -561,13 +561,20 @@ class Editor(QsciScintilla):
if not self.isModified():
self.parent.pc.callWidgetMessageBarEditor(msgEditorBlank, 0, True)
return
if self.isModified() and not autoSave:
self.parent.pc.callWidgetMessageBarEditor(msgEditorUnsaved, 0, True)
return
if self.syntaxCheck(fromContextMenu=False):
if autoSave:
if autoSave and filename:
self.parent.save(filename)
if autoSave and not filename:
# Create a new temp file if the file isn't already saved.
tmpFile = self.createTempFile()
filename = tmpFile
self.parent.pc.shell.runCommand("execfile(r'{0}')".format(filename))
def runSelectedCode(self):