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

[Feature Request] Select Next Occurrence (in addition to currently selected text) #818

Closed
pa-0 opened this issue Jan 17, 2025 · 4 comments · Fixed by #820
Closed

[Feature Request] Select Next Occurrence (in addition to currently selected text) #818

pa-0 opened this issue Jan 17, 2025 · 4 comments · Fixed by #820

Comments

@pa-0
Copy link

pa-0 commented Jan 17, 2025

A common feature of some editors is the ability to select, not only 'all occurrences' but the next occurrence as well. A user has a string of text selected, press Ctrl + D (for example) and the next occurrence of the selected text in the document would also be selected. This is useful where multiple occurrences of a selection need to be edited simultaneously, but not all occurrences in the document.

@cyanzhong
Copy link
Contributor

Thank you for the feedback. This is something nice to have but the keyboard shortcut is a problem here.

VS Code uses Ctrl-D on Windows and Cmd-D on Mac for this feature, but I have just used Cmd-D in #813.

It seems I need to change that since Cmd-D for next occurrence is more widely recognized.

@pa-0
Copy link
Author

pa-0 commented Jan 18, 2025

Yes I believe it's the same in Sublime as well.

I'm reading up on CodeMirror Extensions. my typescript knowledge is little-to-none, but I'm willing to at least attempt to stumble my way into creating a working extension for this myself 😅

selectNextOccurrence StateCommand

Select next occurrence of the current selection. Expand selection to the surrounding word when the selection is empty.

@cyanzhong
Copy link
Contributor

No worries, my implementation in #820 uses the function you mentioned.

I added an entry to the Edit -> Find menu.

@pa-0
Copy link
Author

pa-0 commented Jan 18, 2025

OH WOW I did not expect that!! You ARE AWESOME.

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 a pull request may close this issue.

2 participants