zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.96k stars 1.17k forks source link

Do correct cursor right with storing visual X in `CursorRight` action #3103

Closed dustdfg closed 8 months ago

dustdfg commented 9 months ago

The description was provided by @vicencb:

Here is a concrete example to reproduce the issue i am referring to:

Given this text file:

1234
ABCD
EFGH
IJKL

Move the cursor to 1 if not already there, then SelectDown, then CursorRight and finally CursorDown. After this, the cursor is expected to be at E but instead it is after the H.

vicencb commented 9 months ago

I've just tested it: the issue is fixed. As this issue matched the description of #3055 i tried to avoid creating a duplicate. Are those the same or not?

dustdfg commented 9 months ago

I've just tested it: the issue is fixed. As this issue matched the description of #3055 i tried to avoid creating a duplicate. Are those the same or not?

No the #3055 is about the fact that when you select with mouse the start and end pointers aren't swapped when it is necessary. See new comment in that issue