addon-search: Add "Find Nth" functionality#5798
Open
boborrob wants to merge 1 commit intoxtermjs:masterfrom
Open
addon-search: Add "Find Nth" functionality#5798boborrob wants to merge 1 commit intoxtermjs:masterfrom
boborrob wants to merge 1 commit intoxtermjs:masterfrom
Conversation
- Add an `nthMatchPosition` field to `searchOptions` for locating matches arbitrarily. - Add a `findNth(...)` method analogous to `findNext(...)` and `findPrev(...)`. - Add baseline validations for `nthMatchPosition` (!isNaN, isTruthy, etc.). Rigorous validation is delegated to the client. - Update demo app with 'Find Nth' search controls.
This was referenced Apr 10, 2026
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.
Summary:
Add "Find Nth" functionality to the terminal search feature in order to access matches arbitrarily.
Motivation:
For large sets of search results, cycling through matches sequentially can be cumbersome and time-consuming, especially when the location of the desired match is strongly suspected or known with precision. An input allows the user to jump arbitrarily to the desired match or to get closer to it much faster.
Changes:
Add an
nthMatchPositionfield tosearchOptionsfor locating matches arbitrarily.Add a
findNth(...)method analogous tofindNext(...)andfindPrev(...).Add baseline validations for
nthMatchPosition(!isNaN, isTruthy, etc.). Rigorous validation is delegated to the client where the bounds are better understood pre-invocation.Update demo app with 'Find Nth' search controls.
Example use cases:
VS Code
terminalFindWidgetDemo App Updates