summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Hirtz <hubert@hirtzfr.eu>2020-08-05 14:09:28 +0200
committerHubert Hirtz <hubert@hirtzfr.eu>2020-08-05 14:09:28 +0200
commit6dbbd0b25f8b436255101b5f3a424a078ffdff72 (patch)
tree24fbc2383d3d2cf64655c6ec120feebcb5faf23e
parentAlso handle numpad's enter key (diff)
editor: fix off-by-one error
when writing on the last cell of the row
-rw-r--r--ui/editor.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/ui/editor.go b/ui/editor.go
index c735e48..164a73a 100644
--- a/ui/editor.go
+++ b/ui/editor.go
@@ -100,7 +100,7 @@ func (e *editor) Right() {
return
}
e.cursorIdx++
- if e.width < e.textWidth[e.cursorIdx]-e.textWidth[e.offsetIdx] {
+ if e.width <= e.textWidth[e.cursorIdx]-e.textWidth[e.offsetIdx] {
e.offsetIdx += 16
max := len(e.text) - 1
if max < e.offsetIdx {