commit f1e384d

Hubert Hirtz  ·  2020-08-20 14:27:13 +0000 UTC
parent da8b686
editor: Fix panic when pressing delete on empty input
1 files changed,  +1, -1
+1, -1
1@@ -95,7 +95,7 @@ func (e *editor) RemRune() (ok bool) {
2 }
3 
4 func (e *editor) RemRuneForward() (ok bool) {
5-	ok = e.cursorIdx < len(e.text)
6+	ok = e.cursorIdx < len(e.text[e.lineIdx])
7 	if !ok {
8 		return
9 	}