vscode-neovim: bug: ghost text in editor window when using vim search

Did you check docs and existing issues?

  • I have read all the vscode-neovim docs
  • I have searched the existing issues of vscode-neovim
  • I can reproduce the issue with an empty init.vim/init.lua and no other vscode extensions (when applicable)

Neovim version (nvim -v)

0.9.4

Operating system/version

macOS 14.0

Describe the bug

Quite often when using vim text search via ‘/’, text rendering artefacts appear in the editor when typing the search text, the artefacts are purely visual, the actual content of the edited file is not altered.

Screenshot 2023-10-21 at 15 15 46

Interestingly, when it works as expected, the editor jumps to the first matching occurance, but this ‘jumping to search location’ doesn’t seem to happen when it’s broken, instead those artefacts show up rendered in seemingly random places.

Here’s another example. Strarting to type _sg_wgpu_ first highlighted matches that were already visible in the current editor location, but once the search text was for a match outside the currently visible section, the artefacts appear instead of jumping the function _sg_wgpu_create_buffer further down in the file.

The single e after the semicolon seems to be the last character of the search text btw and changes while typing:

Screenshot 2023-10-21 at 15 27 30

If it helps, this is a pretty large source file (> 18kloc).

Here’s another particularly wild example:

Screenshot 2023-10-21 at 15 38 11

The common theme seems to be that at one point, ‘jump to search location’ stops working and then the artefacts appear instead.

Steps To Reproduce

I have not yet found a reliable way to reproduce this unfortunately, neither with other VSCode extensions or not. My neovim config is vanilla. It happens often enough to be annoying though 😉

The bug is already present for a couple of months at least.

Expected Behavior

No text rendering artifacts when searching text.

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Reactions: 3
  • Comments: 24 (1 by maintainers)

Most upvoted comments

Currently using this autocmd au CmdLineEnter * lua vim.schedule(vim.cmd.nohl) can alleviate this problem.

Okay reprod:

  1. Open VSC
  2. Open File
  3. Ensure you’re at the top of the file and click to select the first line (just to be sure)
  4. Search for evsiw – /evsiw
  5. Jump to it – <enter>
  6. search for evsih – /evish
  7. Note that the highlighted line is overwritten slightly
  8. hit <enter> to go to the searched line, note that the line skips downwards to 200

This works best when evsiw’s matching line is at the bottom of the screen. Same with evsih

Video attached from scratch

https://github.com/vscode-neovim/vscode-neovim/assets/21071450/797aa719-c392-4a71-99ae-a6a9397bbe04

I tried a file with 36k lines and couldn’t reproduce the issue. Please try setting "vscode-neovim.neovimClean": true and give it another try. If possible, please provide a screen recording.