From 93a56c75ce4e4f2aa8fcf61918310dade79a2717 Mon Sep 17 00:00:00 2001 From: henteko Date: Tue, 9 Aug 2016 00:58:29 +0900 Subject: [PATCH] Fixed fail new file save :w --- lib/ex.coffee | 6 +----- spec/ex-commands-spec.coffee | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index 21e4add..28a6380 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -222,11 +222,7 @@ class Ex if not saved and fullPath? if not force and fs.existsSync(fullPath) throw new CommandError("File exists (add ! to override)") - if saveas - editor = atom.workspace.getActiveTextEditor() - trySave(-> editor.saveAs(fullPath, editor)).then(deferred.resolve) - else - trySave(-> saveAs(fullPath, editor)).then(deferred.resolve) + trySave(-> editor.saveAs(fullPath, editor)).then(deferred.resolve) deferred.promise diff --git a/spec/ex-commands-spec.coffee b/spec/ex-commands-spec.coffee index 08237e3..454cd34 100644 --- a/spec/ex-commands-spec.coffee +++ b/spec/ex-commands-spec.coffee @@ -117,7 +117,7 @@ describe "the commands", -> newPath = path.resolve(dir, fs.normalize(newPath)) expect(fs.existsSync(newPath)).toBe(true) expect(fs.readFileSync(newPath, 'utf-8')).toEqual('abc') - expect(editor.isModified()).toBe(true) + expect(editor.isModified()).toBe(false) fs.removeSync(newPath) it "saves to the path", ->