You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to this commit, when hopping forwards, and the initial position to
hop from is a continuation byte, it treats it and each such successive
one as a single character until it gets to a start byte, and switches
into normal mode.
In contrast, in hopping backwards, all the consecutive continuation
bytes are considered to be part of a single character (as they indeed
are).
Thus there is a discrepancy between forward/backwards hopping; and the
forward version seems wrong to me.
This commit removes the discrepancy. There is no change in behavior if
the starting position is to the beginning of a character. All calls in
the core except for the API test are of this form.
But, if the initial position is in the middle of a character, it now
moves to the beginning of the next character, subtracting just 1 from
the count of characters to hop (instead of subtracting however many
continuation bytes there are). This is how I would have expected it to
work all along.
Succinctly, getting to the next character now consumes one hop count, no
matter the direction nor which byte in the character is the starting
position.
0 commit comments