diff options
author | Keith Smiley <k@keith.so> | 2018-02-07 20:42:55 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-07 20:42:55 -0800 |
commit | 2b0cfa495174a3d110b1d68c424ca7666998351d (patch) | |
tree | 45f8e052370f77f7225e4920c546b603dd837637 | |
parent | dcdf60573507a05c987019074c8915bb8287e69a (diff) | |
parent | 2712524d80179535161ed7e97b5164be1011bc3f (diff) | |
download | edit-2b0cfa495174a3d110b1d68c424ca7666998351d.tar.gz edit-2b0cfa495174a3d110b1d68c424ca7666998351d.zip |
Merge pull request #2 from shK3Bq4d/issue1
Preserve current text input when opening the editor
-rw-r--r-- | edit.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -21,7 +21,8 @@ def edit(data, buf, args): editor = (weechat.config_get_plugin("editor") or os.environ.get("EDITOR", "vim -f")) path = os.path.expanduser("~/.weechat/message.txt") - open(path, "w+") + with open(path, "w+") as f: + f.write(weechat.buffer_get_string(buf, "input")) cmd = editor.split() + [path] code = subprocess.Popen(cmd).wait() |