Skip to content
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

Select mode inconsistency #12533

Open
donaldcallen opened this issue Jan 14, 2025 · 1 comment
Open

Select mode inconsistency #12533

donaldcallen opened this issue Jan 14, 2025 · 1 comment

Comments

@donaldcallen
Copy link

If the cursor is on the first character of a word and you press 'e', the cursor moves to the last character of the word with all the characters selected. Now press 'b' and the cursor moves back to the first character, all characters still selected. But if instead of 'b', you press 'v' to enter select mode and then 'b', the cursor moves to the first character and all but the first are now UN-selected. ????

Quoting from the documentation: "Select mode echoes Normal mode, but changes any movements to extend selections rather than replace them." (emphasis mine)

There are other examples of select mode undoing existing selections rather than at least leaving them in place, contrary to what I would expect, given what the documentation says.

@david-crespo
Copy link
Contributor

I think what's happening here is your selection is anchored to its starting point (which in your example is the beginning of the word) even when you only enter visual mode after selecting the word. This is more intuitive in the case where you are on a single character, press v to enter visual mode, then select a bit to the right and then back to the left past the original character. As you describe, movement unselects until you get to the anchor. I do both in the screencap below: starting with a single character and starting at the end of the word.

I agree with you, though, that the wording "changes any movements to extend selections" is misleading. Maybe "modify" would be better.

2025-01-14-helix-visual-mode-anchor-example.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants