Re:TIL the assumption that string length does not change whe...
by yorwba on Monday November 22, 2021 @04:55AM
(#29304678)
Moving the cursor doesn't require string length, it requires finding the new cursor position. You can compute #2 length by moving the cursor one grapheme cluster at a time until you hit the end, but if you only need to move the cursor once, the length is irrelevant. (Also, cursor positions in a terminal-based text editor don't necessarily correspond to graphemes.)
[ Parent
| on HN ]
There are no comments on this comment yet.