From 2712524d80179535161ed7e97b5164be1011bc3f Mon Sep 17 00:00:00 2001 From: Marc Rumo Date: Wed, 7 Feb 2018 09:35:17 +0100 Subject: fixes issue1 --- edit.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/edit.py b/edit.py index a44af9c..f48e0f3 100644 --- a/edit.py +++ b/edit.py @@ -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() -- cgit v1.2.3-70-g09d2