about summary refs log tree commit diff stats
path: root/src/io
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-19 13:04:58 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-19 13:04:58 +0100
commitdad0c1c04b6d4f67da407f69cec98221d178c194 (patch)
treea9e10b4dc425e9d872075e95383ab2e73177f069 /src/io
parent8419f31aca48d73cdecbcc90992884db5d0ffcfc (diff)
downloadchawan-dad0c1c04b6d4f67da407f69cec98221d178c194.tar.gz
lineedit: fix crash in prevHist/nextHist
Diffstat (limited to 'src/io')
-rw-r--r--src/io/lineedit.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/io/lineedit.nim b/src/io/lineedit.nim
index 147793e1..8d18ae25 100644
--- a/src/io/lineedit.nim
+++ b/src/io/lineedit.nim
@@ -335,6 +335,7 @@ proc prevHist(edit: LineEdit) {.jsfunc.} =
       edit.histtmp = $edit.news
     dec edit.histindex
     edit.news = edit.hist.lines[edit.histindex].toRunes()
+    edit.begin()
     edit.end()
     edit.fullRedraw()
 
@@ -342,11 +343,13 @@ proc nextHist(edit: LineEdit) {.jsfunc.} =
   if edit.histindex + 1 < edit.hist.lines.len:
     inc edit.histindex
     edit.news = edit.hist.lines[edit.histindex].toRunes()
+    edit.begin()
     edit.end()
     edit.fullRedraw()
   elif edit.histindex < edit.hist.lines.len:
     inc edit.histindex
     edit.news = edit.histtmp.toRunes()
+    edit.begin()
     edit.end()
     edit.fullRedraw()
     edit.histtmp = ""