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

Search in selection fails because VSCode doesn't have an API to seed the search bar (without selecting next item) #5

Open
jasonwilliams opened this issue Dec 20, 2023 · 1 comment

Comments

@jasonwilliams
Copy link
Owner

jasonwilliams commented Dec 20, 2023

So we have an issue where after selecting multiple occurrences (within a range) you can't then search between them. The obvious method is to execute:

vscode.commands.executeCommand('editor.action.addSelectionToNextFindMatch')

But sadly this does 2 things when we only want it to do 1..
It will both:

  • Add the current selection to the search register.
  • Select the next occurrence of the text in the selection

This doesn't work for selections (ctrl+d/cmd+d), because as soon as you've searched your query and trigger that command, it will immediately select the next occurrence outside of the range what we want.

We want a way to seed the search register without selecting the next match, it doesn't seem VS Code offer this :/
Something like:

vscode.commands.executeCommand('editor.action.addSelectionToSearchRegister')

would be ideal

@jasonwilliams
Copy link
Owner Author

Raised upstream: microsoft/vscode#201338

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

1 participant