From be57a669160b50bedebdcfd90c02dfa887bf8bfe Mon Sep 17 00:00:00 2001 From: Matthew Leeds Date: Wed, 29 Jul 2015 00:24:28 -0500 Subject: [PATCH] Don't allow :edit without a filename for new files. Closes #73. --- lib/ex.coffee | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ex.coffee b/lib/ex.coffee index c7f0d45..08ebd0c 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -112,6 +112,8 @@ class Ex if filePath.indexOf(' ') isnt -1 throw new CommandError('Only one file name allowed') buffer = atom.workspace.getActiveTextEditor().buffer + if filePath is '' and not buffer.getPath()? + throw new CommandError('Nothing to edit') filePath = buffer.getPath() if filePath is '' buffer.setPath(getFullPath(filePath)) buffer.load()