mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-25 17:25:08 +02:00
Previously, it was possible for an up/down arrow press to place the cursor in the middle of a multi-code point grapheme cluster. We want to prevent this in a way that matches the behavior of other browsers. Both Chrome and Firefox will map the starting position to a visually equivalent position in the target line with harfbuzz and ICU segmenters. The need for this is explained in a code comment. The result is a much more natural feeling of text navigation.
19 lines
675 B
Plaintext
19 lines
675 B
Plaintext
Right: position=1 character="e"
|
|
Right: position=2 character="l"
|
|
Right: position=3 character="l"
|
|
Right: position=4 character="o"
|
|
Right: position=5 character=" "
|
|
Down: position=28 character="👩🏼❤️👨🏻"
|
|
Left: position=27 character=" "
|
|
Up: position=2 character="l"
|
|
Right: position=3 character="l"
|
|
Right: position=4 character="o"
|
|
Right: position=5 character=" "
|
|
Right: position=6 character="👩🏼❤️👨🏻"
|
|
Down: position=40 character=" "
|
|
Up: position=6 character="👩🏼❤️👨🏻"
|
|
Down: position=40 character=" "
|
|
Left: position=28 character="👩🏼❤️👨🏻"
|
|
Left: position=27 character=" "
|
|
Up: position=2 character="l"
|