aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Rumo <marc.rumo@kudelskisecurity.com>2018-02-07 09:35:17 +0100
committerMarc Rumo <marc.rumo@kudelskisecurity.com>2018-02-07 09:35:17 +0100
commit2712524d80179535161ed7e97b5164be1011bc3f (patch)
tree45f8e052370f77f7225e4920c546b603dd837637
parentdcdf60573507a05c987019074c8915bb8287e69a (diff)
downloadedit-2712524d80179535161ed7e97b5164be1011bc3f.tar.gz
edit-2712524d80179535161ed7e97b5164be1011bc3f.zip
fixes issue1
-rw-r--r--edit.py3
1 files changed, 2 insertions, 1 deletions
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()