From 8fd1fe14c8a7d366f1a9be699a34339858a78480 Mon Sep 17 00:00:00 2001 From: Loic Nageleisen Date: Tue, 28 Jul 2015 12:02:03 +0200 Subject: [PATCH] Added ~ support Thanks to @romgrk in PR #48 --- lib/ex.coffee | 6 +++--- package.json | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ex.coffee b/lib/ex.coffee index b3e2d4d..c7f0d45 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' VimOption = require './vim-option' trySave = (func) -> @@ -108,7 +108,7 @@ class Ex tabp: => @tabprevious() edit: (range, filePath) -> - filePath = path.normalize(filePath.trim()) + filePath = fs.normalize(filePath.trim()) if filePath.indexOf(' ') isnt -1 throw new CommandError('Only one file name allowed') buffer = atom.workspace.getActiveTextEditor().buffer @@ -124,7 +124,7 @@ class Ex buffer.load() write: (range, filePath) -> - filePath = path.normalize(filePath.trim()) + filePath = fs.normalize(filePath.trim()) deferred = Promise.defer() editor = atom.workspace.getActiveTextEditor() diff --git a/package.json b/package.json index 1f0124a..bf41efc 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": {