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

[RDY] Fix incsearch highlighting disappearing when redrawing from timer #12495

Closed
wants to merge 3 commits into from

Conversation

gelguy
Copy link
Contributor

@gelguy gelguy commented Jun 16, 2020

Redrawing from a timer clears temporary highlights when a floating window needs to be redrawn. Temporary highlights here refers to highlights applied when performing a / search when incsearch is active. This issue is not unique to floating windows, any action that would invalidate highlighting will have the same issue.

This PR only fixes the issue for the Search highlights, IncSearch needs a separate fix.

Minimal init.vim:

let s:height = 1
let s:win = nvim_open_win(0, 0,
      \ {'relative': 'editor', 'height': 1, 'width': 1, 'row': 0, 'col': 0})

function! Foo() abort
  let s:height = 3 - s:height
  call nvim_win_set_config(s:win, {'height': s:height})
  redraw
endfunction

autocmd CmdlineChanged * call timer_start(0, {-> Foo()})

Open a file and do a search to match something in the file. The search highlights will either flash temporarily on the screen or not be appear.

This is somewhat similar to vim/vim#3694, but the redrawing mechanism between Vim and Neovim has diverged quite a bit. The gist behind both issues are the same - (some) temporary highlights are not preserved when redrawing from a timer.

@gelguy
Copy link
Contributor Author

gelguy commented Aug 10, 2021

Closing since code is outdated.

@gelguy gelguy closed this Aug 10, 2021
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 this pull request may close these issues.

None yet

3 participants