diff options
author | bptato <nincsnevem662@gmail.com> | 2023-09-20 22:28:39 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-09-20 22:28:39 +0200 |
commit | 4f6dacd1f189452adad753a0c042c0fbc30144f0 (patch) | |
tree | baefffe2a15833aa4976e02e20fcda4b03586d1e | |
parent | 8aadf052e58643b2003a7e0faedbfcbc27b2f8c9 (diff) | |
download | chawan-4f6dacd1f189452adad753a0c042c0fbc30144f0.tar.gz |
lineedit: fix off by one error in kill
-rw-r--r-- | src/display/lineedit.nim | 4 |
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.} = |