diff options
author | Keith Smiley <keithbsmiley@gmail.com> | 2018-08-30 13:12:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-30 13:12:12 -0700 |
commit | 6aface48202f6027f3800e2bd8330ca626fdcbee (patch) | |
tree | db12b4b1566733a8b62e0a2747ef0d6dd8cff486 | |
parent | 2b0cfa495174a3d110b1d68c424ca7666998351d (diff) | |
parent | 382323d0d4c37d98bb4088e2b4541a2a62180fa5 (diff) | |
download | edit-6aface48202f6027f3800e2bd8330ca626fdcbee.tar.gz edit-6aface48202f6027f3800e2bd8330ca626fdcbee.zip |
Merge pull request #4 from cmhamill/shlex-editor-config
Use shell-style word-splitting on `editor`
-rw-r--r-- | edit.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -13,6 +13,7 @@ import os import os.path +import shlex import subprocess import weechat @@ -24,7 +25,7 @@ def edit(data, buf, args): with open(path, "w+") as f: f.write(weechat.buffer_get_string(buf, "input")) - cmd = editor.split() + [path] + cmd = shlex.split(editor) + [path] code = subprocess.Popen(cmd).wait() if code != 0: os.remove(path) |