neovide / neovide

No Nonsense Neovim Client in Rust
https://neovide.dev
MIT License
12.74k stars 515 forks source link

Moving the cursor sometimes causes the content to jump #2794

Open thirstyice opened 3 days ago

thirstyice commented 3 days ago

Describe the bug A clear and concise description of what the bug is. Moving the cursor up / down sometimes causes the content of the window to appear to jump

To Reproduce Steps to reproduce the behavior:

  1. Load a file. The more lines the better (worse?)
  2. Hold the down arrow (or j, whatever be your preference)

Expected behavior The content scrolls smoothly

Screenshots If applicable, add screenshots to help explain your problem.

https://github.com/user-attachments/assets/caab8609-ca57-4b34-b82f-8c0b0e53c2e8

Desktop (please complete the following information):

Please run neovide --log and paste the contents of the .log file created in the current directory here: neovide_rCURRENT.log

Additional context I have set scrolloff=999 so my cursor is always vertically centered Seems to be less bad in insert mode (maybe to do with cursor width?) Seems to be worse in files with multiple consecutive blank lines I guess it's intermittent, b/c it stopped doing it after I did :bd :e {file} The events of the video are located toward the end of the posted log

fredizzimo commented 2 days ago

I have not checked all the details, but at the first glance it looks like a Neovim bug, since it sends us this

TRACE [neovide::channel_utils] neovim_handler WindowViewport { grid: 2, top_line: 29.0, bottom_line: 65.0, current_line: 46.0, current_column: 0.0, line_count: Some(93.0), scroll_delta: Some(-17.0) }. Notice the scroll_delta of -17.

And between that, it does not send any scroll events at all, which can also be seen in the recording as lack of smooth scrolling.

I will test if I can repeat this myself or not, I have not seen it before, but also not been using a scrollof like that. It could also be a bad inteaction with some plugin.

fredizzimo commented 2 days ago

I think it's some plugin or combination with some other neovim setting that's causing it, since i have not been able to replicate it here locally.

It would be good to try to figure out which.

thirstyice commented 1 day ago

I haven't installed any plugins, so that narrows it down. I'll see if I can replicate it with a subset of my settings and report back

thirstyice commented 1 day ago

Alrighty, did some poking, learned some things:

It's not os specific (also happens on Ubuntu, nvim 0.10.0, neovide 0.13.3) It seems to be an interaction between set scrolloff=999 and set cursorline (I was able to replicate it with just those settings in neovide -- --clean)

fredizzimo commented 9 hours ago

Another datapoint, with the above configuration, just installing https://github.com/lewis6991/gitsigns.nvim fixes the problem