From 9bce86dd4b5fcba9495ba690442e11c0f8218d38 Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Tue, 28 Jul 2015 17:59:48 -0500 Subject: [PATCH] Only update the path for save not saveAs. Save correctly for new files. --- lib/ex.coffee | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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