diff --git a/editor.py b/editor.py index 54ee697..f75365b 100755 --- a/editor.py +++ b/editor.py @@ -8,6 +8,7 @@ import os.path import subprocess import tempfile +import shlex from distutils.spawn import find_executable @@ -75,7 +76,7 @@ def get_tty_filename(): def edit(filename=None, contents=None, use_tty=None): editor = get_editor() - args = [editor] + get_editor_args(os.path.basename(os.path.realpath(editor))) + args = shlex.split(editor) + get_editor_args(os.path.basename(os.path.realpath(editor))) if use_tty is None: use_tty = sys.stdin.isatty() and not sys.stdout.isatty()