Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a separate color for the current match while searching #7212

Closed
adrsm108 opened this issue Oct 31, 2021 · 0 comments · Fixed by #7224
Closed

Use a separate color for the current match while searching #7212

adrsm108 opened this issue Oct 31, 2021 · 0 comments · Fixed by #7224

Comments

@adrsm108
Copy link
Contributor

Is your feature request related to a problem? Please describe.
In vim, incremental search uses the separate IncSearch highlight group to distinguish the current match from other matches. VSCode's native find command has a similar feature, using editor.findMatchBackground for the current match and editor.findMatchHighlightBackground for other matches. Currently, //? in VSCodeVim use the same color for every match in view, which can make it difficult to tell where the cursor will move if the search is confirmed.

Describe the solution you'd like
I'd like the / and ? commands to use a separate decoration for the current match when incsearch is enabled. It would be nice if this defaulted to editor.findMatchBackground, but came with the option to specify background and foreground colors like with vim.searchHighlightColor and vim.searchHighlightTextColor.

Describe alternatives you've considered
Using the native find command gives a similar effect, but always moves the cursor, and isn't integrated with the rest of the extension.

Additional context
Related to #4837, which would support changing the current match before confirming the search. Also somewhat related to #4934, as vim uses the same highlight group for text to be replaced with :s///c.

J-Fields pushed a commit that referenced this issue Dec 31, 2021
- Highlight current match with a different configurable highlight color
- Support `<C-g>`/`<C-t>` to cycle through matches
- Highlight zero-length matches
- Fix a few other edge cases (such as when searching backward or with `^`/`$` with CLRF line endings)

Fixes #7212, fixes #4837
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant