diff --git a/lib/ex.coffee b/lib/ex.coffee index 44ddced..004e3a6 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -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