Only update the path for save not saveAs. Save correctly for new files.
This commit is contained in:
parent
f28a155234
commit
9bce86dd4b
1 changed files with 7 additions and 3 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue