File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -36,19 +36,19 @@ def get_default_editors():
3636
3737def get_editor_args (editor ):
3838 if editor in ['vim' , 'gvim' , 'vim.basic' , 'vim.tiny' ]:
39- return '-f -o'
39+ return [ '-f' , ' -o']
4040
4141 elif editor == 'emacs' :
42- return '-nw'
42+ return [ '-nw' ]
4343
4444 elif editor == 'gedit' :
45- return '-w --new-window'
45+ return [ '-w' , ' --new-window']
4646
4747 elif editor == 'nano' :
48- return '-R'
48+ return [ '-R' ]
4949
5050 else :
51- return ''
51+ return []
5252
5353
5454def get_platform_editor_var ():
@@ -80,8 +80,7 @@ def get_tty_filename():
8080
8181def edit (filename = None , contents = None , use_tty = None ):
8282 editor = get_editor ()
83- args = get_editor_args (os .path .basename (os .path .realpath (editor )))
84- args = [editor ] + args .split (' ' )
83+ args = [editor ] + get_editor_args (os .path .basename (os .path .realpath (editor )))
8584
8685 if use_tty is None :
8786 use_tty = sys .stdin .isatty () and not sys .stdout .isatty ()
You can’t perform that action at this time.
0 commit comments