simonbs / Runestone

📝 Performant plain text editor for iOS with syntax highlighting, line numbers, invisible characters and much more.
MIT License
2.68k stars 150 forks source link

Fixes navigation between word boundaries #348

Closed simonbs closed 7 months ago

simonbs commented 7 months ago

This PR fixes an issue where text selection started behaving incorrectly after navigating between word boundaries. The issue could be reproduced using the following steps:

Shift-arrow up a couple lines, then keeping shift down, option-left or option-right to select out a few words, and then try to adjust the selection with right or left arrows. That's where the selection starts happening at origin instead of in the direction of expansion/contraction.

The bug seems to originate from the workaround that ensures multi-stage text input, such as when writing Korean, works properly. The changes in this PR ensures that both multi-stage text input and navigating between word boundaries work correctly.