commit 6dbbd0b

Hubert Hirtz  ·  2020-08-05 12:09:28 +0000 UTC
parent df91fbf
editor: fix off-by-one error

when writing on the last cell of the row
1 files changed,  +1, -1
+1, -1
1@@ -100,7 +100,7 @@ func (e *editor) Right() {
2 		return
3 	}
4 	e.cursorIdx++
5-	if e.width < e.textWidth[e.cursorIdx]-e.textWidth[e.offsetIdx] {
6+	if e.width <= e.textWidth[e.cursorIdx]-e.textWidth[e.offsetIdx] {
7 		e.offsetIdx += 16
8 		max := len(e.text) - 1
9 		if max < e.offsetIdx {