Added search_selection_bounded to search with word boundaries #4222
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.
This adds a new command
search_selection_bounded
which works likesearch_selection
but adds\b
word boundary markers around. This lets a user emulate the*
behavior from vim as such:(Before I used
shrink_selection
here but that does not work as well)I did not want to touch the behavior of
search_selection
but I think generally that bounded search is likely what users want. It's quite practical when quickly jumping between a function declaration and uses of it in the same file in many languages.Refs #1762 which discusses behavior of the
*
based search.One other significant difference between how search in Vim and Helix works is that as a
*
user you are quite used to the search staying highlighted. That however is an otherwise unrelated issue that (see #1733). Beyond this I think the behavior of*
can be matched now though for people who want it.