Fix several minor search bugs relating to incsearch highlighting and Visual mode#1080
Merged
AlexPl292 merged 8 commits intoJetBrains:masterfrom Jan 22, 2025
Merged
Conversation
f31fde9 to
f229c5d
Compare
As a by-product, this also fixes an off-by-one error where incsearch would effectively treat all Visual searches as exclusive
f229c5d to
93cc47c
Compare
Member
Author
|
Rebased and ready for review |
AlexPl292
approved these changes
Jan 20, 2025
Member
AlexPl292
left a comment
There was a problem hiding this comment.
Looks good for me. Can you add a small doc for my comment?
Member
|
Thank you! |
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.
This PR fixes a number of bugs related to
'incsearch'highlighting while searching in Visual mode, e.g.v/foo'incsearch'would not correctly update an empty selection, when'selection'was set to "exclusive". So something likeve/foowould work butv/foowould not update the selection. The selection would be correctly set when completing the search with<CR>/footo/faa'incsearch'highlighting when'nohlsearch'is set and Visual mode is active. Normally,'incsearch'highlighting is shown for the current match, even when'hlsearch'is disabled, but it's not shown if Visual mode is active - the selection is enough'incsearch'needs to move the caret for a Command-line command, rather than a search. E.g. something likeve:<C-U>normal 3jshould not maintain the Visual selection, butve/fooshouldIt also removes some obsolete tests using the no longer used
'usenewregex'option, and splits up the search related tests intoSearchGroupTest.kt,IncsearchTests.kt,SearchHighlightsTest.kt, etc.This PR depends on theModerefactoring in #1078 and includes all of those commits. To make it easier for me to manage, it's also based on #1079. Once these PRs are merged, I will rebase and force push and mark this PR as no longer draft. Here are the lists of commits for this PR: faeaafd2...f229c5d0