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

Wrong incsearch highlighting when calling nvim_buf_set_lines from timer in cmdline with conceallevel #17810

Closed
Tracked by #6
gelguy opened this issue Mar 21, 2022 · 4 comments · Fixed by #27947
Closed
Tracked by #6
Labels
bug-regression wrong behavior that was introduced in a previous commit (please bisect) highlight
Milestone

Comments

@gelguy
Copy link
Contributor

gelguy commented Mar 21, 2022

Neovim version (nvim -v)

v0.7.0-dev+1292-ge9b53f3fb

Vim (not Nvim) behaves the same?

No

Operating system/version

WSL Ubuntu

Terminal name/version

wsltty

$TERM environment variable

xterm-256color

Installation

Build from source

How to reproduce the issue

" init.vim
autocmd CmdlineChanged * call timer_start(0, {-> Foo()})

let s:buf = nvim_create_buf(v:false, v:true)

function! Foo()
  call nvim_buf_set_lines(s:buf, 0, -1, v:true, [])
  redraw
endfunction
  1. nvim -u init.vim
  2. :h<CR> to open help file
  3. /with<CR> search for text
  4. /Bar<CR> search for another text

Expected behavior

incsearch highlight works as expected.

Actual behavior

When searching for with, the incsearch highlighting is missing.
When searching for Bar, incsearch highlights with instead of Bar.

This is similar to #14064 but with the additional step of nvim_buf_set_lines().

Bisected to 5ab1229: feat: add support for global statusline

@gelguy gelguy added the bug issues reporting wrong behavior label Mar 21, 2022
@clason
Copy link
Member

clason commented Mar 21, 2022

Can you test with latest master? The version you list looks quite outdated.

@gelguy
Copy link
Contributor Author

gelguy commented Mar 21, 2022

Oops! This occurs on latest nightly, e9b53f3fb56e91a0d4f15bb36d8068bcc6ea88cf. I pasted the version I bisected to instead of the version on master. I"ve updated the issue accordingly.

@zeertzjq zeertzjq added bug-regression wrong behavior that was introduced in a previous commit (please bisect) highlight labels Mar 21, 2022
@dundargoc dundargoc removed the bug issues reporting wrong behavior label Apr 8, 2022
@gelguy
Copy link
Contributor Author

gelguy commented Jun 19, 2022

I"ve realised the bug only occurs when conceallevel is non-zero. My repro steps unintentionally used a help file which sets conceallevel=2.

I"ve updated the title accordingly.

@gelguy gelguy changed the title Wrong incsearch highlighting when calling nvim_buf_set_lines from timer in cmdline Wrong incsearch highlighting when calling nvim_buf_set_lines from timer in cmdline with conceallevel Jun 19, 2022
@folke
Copy link
Member

folke commented Sep 30, 2022

@bfredl this causes issues with ext_cmdline when entering search and rendering the search ui.

To fix this, I currently set conceallevel=0 when entering the cmdline with firstc=? or /, and then setting it back when leaving the commandline, but would be great to also add this to the roadmap for 0.9.0 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-regression wrong behavior that was introduced in a previous commit (please bisect) highlight
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants