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()
|
fullPath = atom.showSaveDialogSync()
|
||||||
if fullPath?
|
if fullPath?
|
||||||
if filePath is ''
|
if filePath is ''
|
||||||
|
if editor.getPath()?
|
||||||
trySave(-> editor.save())
|
trySave(-> editor.save())
|
||||||
.then deferred.resolve
|
.then deferred.resolve
|
||||||
else
|
else
|
||||||
trySave(-> saveAs(fullPath))
|
trySave(-> editor.saveAs(fullPath))
|
||||||
.then deferred.resolve
|
.then deferred.resolve
|
||||||
editor.buffer.setPath(fullPath)
|
editor.buffer.setPath(fullPath)
|
||||||
|
else
|
||||||
|
trySave(-> saveAs(fullPath))
|
||||||
|
.then deferred.resolve
|
||||||
|
|
||||||
deferred.promise
|
deferred.promise
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue