Fix several minor search bugs relating to incsearch highlighting and Visual mode #1080
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/foo
would work butv/foo
would not update the selection. The selection would be correctly set when completing the search with<CR>
/foo
to/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 3j
should not maintain the Visual selection, butve/foo
shouldIt 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 theMode
refactoring 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