mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 06:42:25 +02:00
Fix exception on right arrow key at second to last character (#3721)
This commit is contained in:
@@ -483,16 +483,10 @@ public static class Rope
|
||||
[Pure]
|
||||
public static long RuneShiftRight(long index, Node rope)
|
||||
{
|
||||
index += 1;
|
||||
if (char.IsHighSurrogate(Index(rope, index)))
|
||||
return index + 2;
|
||||
|
||||
// Before you confuse yourself on "shouldn't this be high surrogate since shifting left checks low"
|
||||
// (Because yes, I did myself too a week after writing it)
|
||||
// char.IsLowSurrogate(_text[_cursorPosition]) means "is the cursor between a surrogate pair"
|
||||
// because we ALREADY moved.
|
||||
if (char.IsLowSurrogate(Index(rope, index)))
|
||||
index += 1;
|
||||
|
||||
return index;
|
||||
return index + 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user