From 47aa63c64a6ed398ac6c9ab616da3aec01fe1628 Mon Sep 17 00:00:00 2001 From: Josh Davis Date: Sun, 11 Jan 2015 20:16:21 -0800 Subject: [PATCH] Allow editor config value to be either list or str --- jrnl/util.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jrnl/util.py b/jrnl/util.py index 223ff00e..a9515b79 100644 --- a/jrnl/util.py +++ b/jrnl/util.py @@ -121,7 +121,9 @@ def get_text_from_editor(config, template=""): with codecs.open(tmpfile, 'w', "utf-8") as f: if template: f.write(template) - subprocess.call(config['editor'].split() + [tmpfile]) + editor = config['editor'] + args = editor if isinstance(editor, list) else editor.split() + subprocess.call(args + [tmpfile]) with codecs.open(tmpfile, "r", "utf-8") as f: raw = f.read() os.close(filehandle)