feat(input): select the next occurrence, or all of them, as more selections - #2
Merged
Merged
Conversation
trancong12102
force-pushed
the
feat/select-occurrences
branch
from
October 1, 2026 15:45
ab0ee5e to
f8e5e45
Compare
…ctions SelectNextOccurrence selects the word under a caret, then adds the next occurrence of the selected text as another selection, wrapping past the end; SelectAllOccurrences adds every one. Both are code-editor and textarea actions with no default key, so an application binds them. lsp_types is re-exported, so a provider names the types it speaks without a dependency of its own to keep in step. Co-Authored-By: Claude Code
trancong12102
force-pushed
the
feat/select-occurrences
branch
from
October 1, 2026 16:12
f8e5e45 to
66bedc3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds ⌘D-style occurrence selection to the multi-line inputs (code editor and textarea), built on the existing multi-cursor selections. No upstream PR covers it (checked longbridge/gpui-component's open PRs on 2026-10-01).
SelectNextOccurrencethen adds the next occurrence of the newest selection's text as another selection, wrapping past the end and skipping text already selected, and scrolls to it.SelectAllOccurrencesadds every occurrence.Public API
gpui-base(re-exported fromgpui-component'sinput):actions::SelectNextOccurrence: select the word, then add the next occurrence as a selection.actions::SelectAllOccurrences: select the word, then every occurrence.pub use lsp_types;ingpui_base::input: the LSP types the providers speak, so aCompletionProviderimplementer needs nolsp-typesdependency pinned to the same version.Tests:
input::occurrences::tests(word first then wrap, all at once, a caret off any word).cargo clippy -p gpui-basefails on main already withtoo_many_argumentsindock_area.rsandtext_wrapper.rs, untouched here.Co-Authored-By: Claude Code