diff --git a/widget/editor_test.go b/widget/editor_test.go index 76034956..b0aa2313 100644 --- a/widget/editor_test.go +++ b/widget/editor_test.go @@ -421,16 +421,13 @@ func TestEditorLigature(t *testing.T) { // Ensure that all runes in the final cluster of a line are properly // decoded when moving to the end of the line. This is a regression test. e.moveEnd(selectionClear) - // Because the first line is broken due to line wrapping, the last - // rune of the line will not be before the cursor. - assertCaret(t, e, 0, 13, len("fflffl fflffl")) + // The first line was broken by line wrapping, not a newline character. As such, + // the cursor can reach the position after the final glyph (a space). + assertCaret(t, e, 0, 14, len("fflffl fflffl ")) e.moveLines(1, selectionClear) - // Because the space is at the beginning of the second line and - // the second line is the final line, there are two more runes - // before the cursor than on the first line. assertCaret(t, e, 1, 13, len("fflffl fflffl fflffl fflffl")) e.moveLines(-1, selectionClear) - assertCaret(t, e, 0, 13, len("fflffl fflffl")) + assertCaret(t, e, 0, 14, len("fflffl fflffl ")) // Absurdly narrow constraints to force each ligature onto its own line. gtx.Constraints = layout.Exact(image.Pt(10, 10))