When moving up/down through lines of varying lengths, the editor now remembers the original column position and restores it when reaching a line long enough to accommodate it. Example: cursor at column 10, move up to a shorter line (cursor clamps to end), move up again to a longer line - cursor returns to column 10. Implementation: - Add preferredVisualCol instance property (nullable) - Set it when moving to a shorter line during vertical navigation - Clear it when arriving at a line that fits the preferred column - Clear it on any horizontal movement or editing via setCursorCol() - Detect line rewrap by checking if cursor is in middle of line - When pressing right at end of prompt, set preferredVisualCol so subsequent up/down navigation uses that column position
92 KiB
92 KiB