aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--edit.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/edit.py b/edit.py
index 42f966f..40c3653 100644
--- a/edit.py
+++ b/edit.py
@@ -21,6 +21,7 @@ def edit(data, buf, args):
cmd = [editor, path]
code = subprocess.Popen(cmd).wait()
if code != 0:
+ os.remove(path)
weechat.command(buf, "/window refresh")
return weechat.WEECHAT_RC_ERROR
@@ -29,6 +30,7 @@ def edit(data, buf, args):
weechat.buffer_set(buf, "input", text)
weechat.buffer_set(buf, "input_pos", str(len(text)))
+ os.remove(path)
weechat.command(buf, "/window refresh")
return weechat.WEECHAT_RC_OK