Only update the path for save not saveAs. Save correctly for new files.

This commit is contained in:
Matthew Leeds 2015-07-28 17:59:48 -05:00
parent f28a155234
commit 9bce86dd4b

View file

@ -141,12 +141,16 @@ class Ex
fullPath = atom.showSaveDialogSync()
if fullPath?
if filePath is ''
trySave(-> editor.save())
.then deferred.resolve
if editor.getPath()?
trySave(-> editor.save())
.then deferred.resolve
else
trySave(-> editor.saveAs(fullPath))
.then deferred.resolve
editor.buffer.setPath(fullPath)
else
trySave(-> saveAs(fullPath))
.then deferred.resolve
editor.buffer.setPath(fullPath)
deferred.promise