diff options
author | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-20 16:27:13 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-20 16:27:13 +0200 |
commit | f1e384d4d7658e255fa7a22d7c6e555537a836a9 (patch) | |
tree | 643ed746d5989e7862f92744cee05215646afbc2 | |
parent | ui: 1-cell padding for highlight nicks (diff) |
editor: Fix panic when pressing delete on empty input
-rw-r--r-- | ui/editor.go | 2 |
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 } |