add fs-plus dependency; fix edit
This commit is contained in:
parent
bf0f492740
commit
fc5a30c005
2 changed files with 7 additions and 6 deletions
|
|
@ -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...)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue