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

Use next bracket text object if cursor is not currently within a bracket text object #3025

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JochenBaier
Copy link

@JochenBaier JochenBaier commented Nov 1, 2022

Emulate the behavior of Vim (compared with gvim 9.0.57 on Windows) to use the next bracket text object when the cursor is not inside a bracket text object. The next bracket text object is searched using the opening bracket character.

Example (cursor is italic, selected text is bold):
cat (fish) dog -> vib -> cat (fish) dog
cat (fish) dog -> vab -> cat (fish) dog

Please double check PR, this is my first contact with VsVim source code and my first contact with F#.

…bject

Emulate the behavior of Vim to use the next bracket text object when the cursor is not inside a bracket text object.
The next bracket text object search using the opening bracket character.
@lawrence-laz
Copy link

As I understand this currently supports brackets only, right? Could this be improved to cover vi", vi>, vi', etc. without too much effort? Related to #3046 .

@JochenBaier
Copy link
Author

As I understand this currently supports brackets only, right? Could this be improved to cover vi", vi>, vi', etc. without too much effort? Related to #3046 .

" and ' is already supported without the patch
<> is only supported within

@nosami
Copy link
Collaborator

nosami commented Nov 16, 2023

This PR seems very useful. Did you look to see how vi" works today?

I'm not totally familiar with how this code works but it seems like it is using VisualCommand.MoveCaretToTextObject to move the caret to the first ".
It seems like it would be a smaller change to make the existing code work for ( and <

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

Successfully merging this pull request may close these issues.

None yet

3 participants