aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--edit.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/edit.py b/edit.py
index ca6ab3f..503bc6f 100644
--- a/edit.py
+++ b/edit.py
@@ -60,6 +60,9 @@ def read_file(path, buf):
with open(PATH) as f:
text = f.read()
+ if text[-1] == "\n":
+ text = text[:-1] # remove trailing newline if exists.
+
weechat.buffer_set(buf, "input", text)
weechat.buffer_set(buf, "input_pos", str(len(text)))