mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-18 03:58:32 +02:00
Merge cb972f511c
into 9ffca1a7a6
This commit is contained in:
commit
820d0a183f
2 changed files with 4 additions and 2 deletions
|
@ -18,7 +18,7 @@ The configuration file is a simple JSON file with the following options and can
|
|||
- ``journals``
|
||||
paths to your journal files
|
||||
- ``editor``
|
||||
if set, executes this command to launch an external editor for writing your entries, e.g. ``vim``. Some editors require special options to work properly, see :doc:`FAQ <recipes>` for details.
|
||||
if set, executes this command to launch an external editor for writing your entries, e.g. ``vim``. Some editors require special options to work properly, see :doc:`FAQ <recipes>` for details. This value can either be a string such as the earlier ``"editor": "vim"`` example or ``"editor": ["vim", "+set ft=markdown"]`` if you want to pass arguments to the editor.
|
||||
- ``encrypt``
|
||||
if ``true``, encrypts your journal using AES.
|
||||
- ``tagsymbols``
|
||||
|
|
|
@ -130,7 +130,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.remove(tmpfile)
|
||||
|
|
Loading…
Add table
Reference in a new issue