about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-09-20 22:28:39 +0200
committerbptato <nincsnevem662@gmail.com>2023-09-20 22:28:39 +0200
commit4f6dacd1f189452adad753a0c042c0fbc30144f0 (patch)
treebaefffe2a15833aa4976e02e20fcda4b03586d1e
parent8aadf052e58643b2003a7e0faedbfcbc27b2f8c9 (diff)
downloadchawan-4f6dacd1f189452adad753a0c042c0fbc30144f0.tar.gz
lineedit: fix off by one error in kill
-rw-r--r--src/display/lineedit.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/display/lineedit.nim b/src/display/lineedit.nim
index 53223be9..bcca28fe 100644
--- a/src/display/lineedit.nim
+++ b/src/display/lineedit.nim
@@ -186,8 +186,8 @@ proc clear(edit: LineEdit) {.jsfunc.} =
     edit.invalid = true
 
 proc kill(edit: LineEdit) {.jsfunc.} =
-  if edit.cursori > 0 and edit.cursori < edit.news.len:
-    edit.news.setLen(edit.cursori - 1)
+  if edit.cursori < edit.news.len:
+    edit.news.setLen(edit.cursori)
     edit.invalid = true
 
 proc backward(edit: LineEdit) {.jsfunc.} =