mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-19 04:28:31 +02:00
editor: use shell to launch editor to allow spaces in editor command
If I want to set a filetype in vim on opening the journla, e.g.: vim -c 'set ft=notes' -c Goyo -f the set and ft=notes will be split and interpreted as two files in vim. Using the shell to execute the command makes it possible to have editor commands with quoted/escaped spaces in them.
This commit is contained in:
parent
4aa458d31a
commit
460179efdd
1 changed files with 1 additions and 1 deletions
|
@ -130,7 +130,7 @@ def get_text_from_editor(config, template=""):
|
||||||
with codecs.open(tmpfile, 'w', "utf-8") as f:
|
with codecs.open(tmpfile, 'w', "utf-8") as f:
|
||||||
if template:
|
if template:
|
||||||
f.write(template)
|
f.write(template)
|
||||||
subprocess.call(config['editor'].split() + [tmpfile])
|
subprocess.call(config['editor'] + " " + tmpfile, shell = True)
|
||||||
with codecs.open(tmpfile, "r", "utf-8") as f:
|
with codecs.open(tmpfile, "r", "utf-8") as f:
|
||||||
raw = f.read()
|
raw = f.read()
|
||||||
os.remove(tmpfile)
|
os.remove(tmpfile)
|
||||||
|
|
Loading…
Add table
Reference in a new issue