widget: fix moveLines residual x offset calculation

Commit c22138f5f broke it, this change fixes it.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-02-16 19:40:55 +01:00
parent 845d35dd50
commit 2df3db361f
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -120,6 +120,14 @@ func TestEditor(t *testing.T) {
}
}
}
// Test that moveLine applies x offsets from previous moves.
e.SetText("long line\nshort")
e.SetCaret(0, 0)
e.moveEnd(selectionClear)
e.moveLines(+1, selectionClear)
e.moveLines(-1, selectionClear)
assertCaret(t, e, 0, utf8.RuneCountInString("long line"), len("long line"))
}
func TestEditorDimensions(t *testing.T) {