You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently extend selection till (t) makes an assumption about the users intent.
Saying Hey the character you wanted to select until is right next to the cursor as you did not want to do nothing I will instead look for the character from cursor+1 which makes sense for a single cursor.
For multi cursor it is very annoying. Consider this situation:
1) something
2) another thing
…
10) end
then setting the cursor at 1 using the commands 9Ct) one would expect to have the numbers selected in their own selections but because for numbers 1-9 ) is at cursor+1 almost all of the text is selected. Using f)vh works just fine.
This behaviour is undocumented (as far as I can tell), confusing and thus I consider it a bug. It is however very much intensional in the code.
It looks like this was intentional and discussed when initially introduced: #891 (comment)
I would agree though that the command is more predicable, especially in multi-cursor scenarios, when it does nothing in the case of the search character being right next to the selection. Maybe a compromise behavior could be to check that all selections have the search character right next to the selection and only skip the character then.
About documentation though: there isn't a place currently for documenting nuances like this, that would be covered by something like #668
TheoCorn
changed the title
Undocumented behavior of extend_till_char
Unexpected behavior of extend_till_char for multiple cursors
Sep 26, 2024
Type f<ch> to select up to and including (find) a character.
Type t<ch> to do the same, but not including (till) a character.
Giving a false impression. But tutor is a get started kind of thing so I get why it wasn't and maybe shouldn't be added. Something like #668 would be best.
Summary
Currently extend selection till (
t
) makes an assumption about the users intent.Saying Hey the character you wanted to select until is right next to the cursor as you did not want to do nothing I will instead look for the character from cursor+1 which makes sense for a single cursor.
For multi cursor it is very annoying. Consider this situation:
then setting the cursor at
1
using the commands9Ct)
one would expect to have the numbers selected in their own selections but because for numbers 1-9)
is at cursor+1 almost all of the text is selected. Usingf)vh
works just fine.This behaviour is undocumented (as far as I can tell), confusing and thus I consider it a bug. It is however very much intensional in the code.
helix/helix-term/src/commands.rs
Lines 1595 to 1598 in b18a471
Reproduction Steps
set cursor to
8
then2Ct)
Helix log
No response
Platform
Linux
Terminal Emulator
Alacritty
Installation Method
source
Helix Version
helix 24.7 (b18a471)
The text was updated successfully, but these errors were encountered: