-
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 behavior of cursor keys depending on whether selection mode is active (newlines) after upgrading to 2.0.14 #3476
Comments
The PR that caused this regression: #3091. @dustdfg FYI. The intention of #3091 was to provide consistent cursor movements after a multiline selection: make sure that moving cursor down moves it to the next line after the last line of the selection, not after the first line of the selection. And as side effect, it also caused the cursor position within the line to move to the character below the end of the selection, not below the start of the selection. AFAICS gedit editor behaves similarly to micro with #3091 in this regard, but at the same time doesn't have this issue with newlines. IOW when moving cursor down, gedit moves to the character below the end of selection (like micro with #3091), however in the case when the selection end at a newline, gedit moves the cursor to the beginning of the next line (unlike micro with #3091). So to fix this regression, we might want to mimic gedit behavior. |
I am not much interested in micro and busy with other things for now so I didn't thoroughly read and investigated but it somehow remembered me about this: #3103. Idk if it is related or not but looks similar |
@dmaluka is right, this was introduced with #3091. Before going down...
Currently I can't directly compare to |
@JoeKar any updates on this? |
In case you're comfortable by testing unmerged PRs feel free to try out #3540. |
Description of the problem or steps to reproduce
Create a new file with the following content:
Position cursor to
1
, press arrow down, observe that the cursor is currently at4
, as expected.Position cursor to
4
, press arrow down, observe that the cursor is currently ata
, as expected.Now position cursor to
1
, press Shift + arrow down, observe that the entire line123
is selected (including the trailing newline), as expected. Press arrow down again to clear the selection and move to the next line, observe that the cursor is currently at7
, which is not expected and not how other similar text editors typically work (expected would be the cursor at4
ora
).Position cursor to
4
, repeat the same steps, observe that the cursor is now onabc
line afterc
(expected would be the cursor ata
ord
).Basically the problem is that after selection with Shift+down, the cursor seems to move to the newline character of the selected line, rather than the place immediately below the originally focused character (or the rightmost place of the line below if it's too short and doesn't reach the originally focused character).
This breaks patterns like: "Ctrl+Home, Shift+down, Ctrl+C, down, down, Ctrl+V" which used to insert a copy of the first line as the new line between two other lines, but now instead appends a copy of the first line (including the newline character) to the other line.
In 2.0.13 this used to work as expected, producing for the document
the new content
But the behavior changed in 2.0.14, and the same commands now produce
Specifications
Commit hash: 04c5770
OS: Alpine Linux Edge (rolling release) x86_64
Terminal: foot 1.18.1, also reproducible on wezterm 20240203.110809.
The text was updated successfully, but these errors were encountered: