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

bug: scrolling quickly can interfere with highlights #1948

Open
3 tasks done
ollien opened this issue May 8, 2024 · 1 comment
Open
3 tasks done

bug: scrolling quickly can interfere with highlights #1948

ollien opened this issue May 8, 2024 · 1 comment
Labels
bug Something isn't working manager: viewport

Comments

@ollien
Copy link
Collaborator

ollien commented May 8, 2024

Check the following:

  • I have checked the behavior after setting "vscode-neovim.neovimClean" in VSCode settings.
  • I have read the vscode-neovim docs.
  • I have searched existing issues.

Neovim version (nvim -v)

v0.9.5

Operating system/version

Fedora 39

Describe the bug

I admit, this one is a bit tough to reproduce, but I have managed to reproduce it. I originally thought this might be a bug with #1940, but I can reproduce it with master.

When you scroll quickly in a file, sometimes highlights are removed from the screen. I suspect there is somehow a race between our tracking of the viewport and the tracking of the highlights.

I found this bug, which was marked as a duplicate, but I could not find what it was marked as a duplicate of? #1833

Steps To Reproduce

  1. Open a file that you are able to scroll significantly in
  2. Search for text with /, and move your cursor to another line.
  3. Scroll up and down quickly with your mouse, and notice highlights disappear

Here's a recording of me searching for /jest in https://github.com/jestjs/jest/blob/726ca20752e38c18e20aa21740cec7aba7891946/package.json. Keep your eye on line 1, and notice the highlight disappears.

recording-2024-05-07_21.22.25.mp4

Expected Behavior

The existence of the highlight should not depend on how quickly one scrolls

@ollien ollien added the bug Something isn't working label May 8, 2024
@xiyaowong
Copy link
Collaborator

xiyaowong commented May 8, 2024

If it's just that the highlighting takes a while to appear, that's expected. Scrolling must be debounced, so it's an unavoidable phenomenon.

private onDidChangeVisibleRange = async (e: TextEditorVisibleRangesChangeEvent): Promise<void> => {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working manager: viewport
Projects
None yet
Development

No branches or pull requests

2 participants