From fc5a30c00538a4d45955e138c0d35f72c8c2a58f Mon Sep 17 00:00:00 2001 From: Rom Grk Date: Fri, 29 May 2015 08:41:07 -0400 Subject: [PATCH] add fs-plus dependency; fix edit --- lib/ex.coffee | 10 +++++----- package.json | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index 21f5037..5ad6be5 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -1,6 +1,6 @@ path = require 'path' CommandError = require './command-error' -fs = require 'fs' +fs = require 'fs-plus' trySave = (func) -> deferred = Promise.defer() @@ -102,10 +102,10 @@ class Ex filePath = filePath.trim() if filePath.indexOf(' ') isnt -1 throw new CommandError('Only one file name allowed') - buffer = atom.workspace.getActiveTextEditor().buffer - filePath = buffer.getPath() if filePath is '' - buffer.setPath(getFullPath(filePath)) - buffer.load() + + filePath = fs.normalize filePath + atom.workspace.open(filePath) + e: (args...) => @edit(args...) diff --git a/package.json b/package.json index 3364f3e..6960bb2 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "underscore-plus": "1.x", "event-kit": "^0.7.2", "space-pen": "^5.1.1", - "atom-space-pen-views": "^2.0.4" + "atom-space-pen-views": "^2.0.4", + "fs-plus": "^2.2.8" }, "consumedServices": { "vim-mode": {