add fs-plus dependency; fix edit

This commit is contained in:
Rom Grk 2015-05-29 08:41:07 -04:00
parent bf0f492740
commit fc5a30c005
2 changed files with 7 additions and 6 deletions

View file

@ -1,6 +1,6 @@
path = require 'path' path = require 'path'
CommandError = require './command-error' CommandError = require './command-error'
fs = require 'fs' fs = require 'fs-plus'
trySave = (func) -> trySave = (func) ->
deferred = Promise.defer() deferred = Promise.defer()
@ -102,10 +102,10 @@ class Ex
filePath = filePath.trim() filePath = filePath.trim()
if filePath.indexOf(' ') isnt -1 if filePath.indexOf(' ') isnt -1
throw new CommandError('Only one file name allowed') throw new CommandError('Only one file name allowed')
buffer = atom.workspace.getActiveTextEditor().buffer
filePath = buffer.getPath() if filePath is '' filePath = fs.normalize filePath
buffer.setPath(getFullPath(filePath)) atom.workspace.open(filePath)
buffer.load()
e: (args...) => @edit(args...) e: (args...) => @edit(args...)

View file

@ -15,7 +15,8 @@
"underscore-plus": "1.x", "underscore-plus": "1.x",
"event-kit": "^0.7.2", "event-kit": "^0.7.2",
"space-pen": "^5.1.1", "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": { "consumedServices": {
"vim-mode": { "vim-mode": {