Move a caret up (direction = -1) or down (+1) one line, keeping the
horizontal position — pass desiredX to preserve a "sticky column" across
repeated vertical moves. Moving up from the first line goes to index 0;
moving down from the last goes to the end of the text (matching DOM
textarea behavior).
Move a caret up (
direction = -1) or down (+1) one line, keeping the horizontal position — passdesiredXto preserve a "sticky column" across repeated vertical moves. Moving up from the first line goes to index 0; moving down from the last goes to the end of the text (matching DOM textarea behavior).