-
Notifications
You must be signed in to change notification settings - Fork 780
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
add vscode go next
command
#1208
base: main
Are you sure you want to change the base?
Conversation
Should we replace the |
I tend to think of "go…" commands as navigation (changes your view/insertion point location) rather than search (affects the selection) commands. Most of the search commands in knausj are of the form "hunt…" — so for example "hunt this; hunt next" would do something similar to this. Cursorless also has "scout" that takes the usual targets. There's a few different variations among the "start a text search in this file" commands:
The command as implemented here appears to be "yes, no, yes". The standard VSCode Find command is "yes, yes, no" (though in most apps it is "no, yes, no"). VSCode and most Mac apps also have Find with Selection/Use Selection for Find (actions.findWithSelection) which is "yes, no, no". Find next is "no, no, yes". I think there's room for at least one more of these variants implemented in For example, we could make the text optional in "select next": https://github.com/knausj85/knausj_talon/blob/c8181e2876cd05cc9dfa4bfa7aaed209819088ce/tags/find_and_replace/find_and_replace.talon#L91 |
Exactly we already have a file with find commands and each application should context specifically implement these instead of adding new ones. community/apps/vscode/vscode.py Lines 291 to 292 in 1413599
|
From a workflow/convenience perspective, it's nice that once something is selected, you can simply "go next" to go to the next instance of it rather than depending on the state of the search text field and worrying about whether the editor or the search thingy has focus. I've also edited my initial comment to be more accurate:
|
Okay that is a subtle distinction since most of the time when you are searching your selection is the same as the search result, but from your description I think we're use in the wrong thing. |
I agree. We have "hunt next" and "hunt previous" to call |
I don't think the commands that care about selection is intentional. I would argue we should just use the ones that goes to next search result. Or do you actually use both? |
I use both. Here is the appeal of "go next":
Versus the "hunt ..." commands:
|
We discussed this on the community backlog session today and would prefer this be implemented as a variant of "select next" (see my prior comment: #1208 (comment)). |
editor.action.nextSelectionMatchFindAction
will jump to next hit of the current selection/token. I think if there is no selection and the cursor is not touching a token, then it will try to use the latest Ctrl+F search term.