summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtzfr.eu>2020-08-20 16:27:13 +0200
committerHubert Hirtz <hubert@hirtzfr.eu>2020-08-20 16:27:13 +0200
commitf1e384d4d7658e255fa7a22d7c6e555537a836a9 (patch)
tree643ed746d5989e7862f92744cee05215646afbc2
parentui: 1-cell padding for highlight nicks (diff)
editor: Fix panic when pressing delete on empty input
-rw-r--r--ui/editor.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/editor.go b/ui/editor.go
index 66f230f..33cf736 100644
--- a/ui/editor.go
+++ b/ui/editor.go
@@ -95,7 +95,7 @@ func (e *editor) RemRune() (ok bool) {
}
func (e *editor) RemRuneForward() (ok bool) {
- ok = e.cursorIdx < len(e.text)
+ ok = e.cursorIdx < len(e.text[e.lineIdx])
if !ok {
return
}