Skip to content

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

@gelguy

Description

@gelguy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug-regressionwrong behavior that was introduced in a previous commit (please bisect)highlight

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions