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

incremental search and highlight all matches stops working with existing highlight #179

Open
kting28 opened this issue Feb 22, 2023 · 1 comment

Comments

@kting28
Copy link

kting28 commented Feb 22, 2023

Hard to describe in words please see gif below. In general, with wilder's / and ? matching enabled, nvim's incremental highlight is disabled if there's an existing search highlight.
wilder_search_incremental

The initial search of /test has incremental highlight. After hitting return, the next search /est has no incremental highlight. In nvim without wilder, every new search has incremental highlight.

Is this intentional ?

@kting28
Copy link
Author

kting28 commented Mar 10, 2023

I found the workaround apply_incsearch_fix enabled would fix this issue. But it breaks the <Up> <Down> arrows in / mode. After trying a few things I found that changing the line below to noh instead of feedkeys fixed the issue.

function! s:redraw(apply_incsearch_fix, is_redrawstatus) abort
  if a:apply_incsearch_fix &&
        \ &incsearch &&
        \ (getcmdtype() ==# '/' || getcmdtype() ==# '?')
    noh  "This restores the incsearch in all cases
    return
  endif

The problem is that when / is first pressed, the initial match suggestions are no longer shown. But this is not an issue for me ..

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

No branches or pull requests

1 participant