Check editor from path (and traverse symlinks)

Fixes #4
This commit is contained in:
Peter Ruibal 2015-12-02 22:13:08 -08:00
parent d6fa2a6bb3
commit 97b8ef222d
1 changed files with 2 additions and 1 deletions

View File

@ -26,6 +26,7 @@ class EditorError(RuntimeError):
def get_default_editors():
# TODO: Make platform-specific
return [
'editor',
'vim',
'emacs',
'nano',
@ -72,7 +73,7 @@ def get_editor():
def edit(filename=None, contents=None):
editor = get_editor()
args = get_editor_args(os.path.basename(editor))
args = get_editor_args(os.path.basename(os.path.realpath(editor)))
args = [editor] + args.split(' ')
if filename is None: