-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inconsistent cursor up/down moving after selecting with keyboard/mouse #3055
Comments
Direction of text selection with mouse matters so it seems to me that it just "swaps" two coordinates in micro/internal/buffer/cursor.go Lines 19 to 35 in 2d82362
It looks like if you start select from end (with mouse) it will set the end coordinate to "start" part of micro/internal/buffer/cursor.go Lines 146 to 154 in 2d82362
|
I also have noticed some cursor placement inconsistencies after a selection: for example, this sequence |
|
No, i was not referring to this use case. Here is a concrete example to reproduce the issue i am referring to: Given this text file:
Move the cursor to |
I will try to rephrase and describe it in a bit another way. When you do It isn't a big issue and it can be swapped very easily with 2-5 lines somewhere but now I don't know where it should be done. Alternatives that I see:
|
Ensure that the selection start is always before the selection end, regardless of the direction of a mouse selection, to make h.Cursor.Deselect() handle its `start` argument correctly. This makes the cursor behavior after mouse selections consistent with the cursor behavior after keyboard selections. Fixes zyedidia#3055
Ensure that the selection start is always before the selection end, regardless of the direction of a mouse selection, to make h.Cursor.Deselect() handle its `start` argument correctly. This makes the cursor behavior after mouse selections consistent with the cursor behavior after keyboard selections. Fixes #3055
Description of the problem or steps to reproduce
It isn't a problem (maybe the most minor bug ever).
When you select text with keyboard (Shift+) and after selecting press up/down the cursor will appear from the left side. It doesn't matter what direction of selecting was.
When you do the same with mouse the result will be different. (Only) if you started select from right to left, the up/down action will place cursor from the right side.
Specifications
Commit hash: v2.0.13 68d88b5
OS: Debian 12
Terminal: foot/gnome-terminal
The text was updated successfully, but these errors were encountered: