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

Cursor weird movement when having 3 split windows #2516

Open
ThaiDuy12345 opened this issue Apr 30, 2024 · 6 comments
Open

Cursor weird movement when having 3 split windows #2516

ThaiDuy12345 opened this issue Apr 30, 2024 · 6 comments
Labels
bug Something isn't working neovim-upstream Requires/is blocked on a change in Neovim itself

Comments

@ThaiDuy12345
Copy link

Describe the bug
When having 3 windows split on your screen, like in this video I provide which are Neotree, toggleterm and the main buffer. When I interact to my main buffer, in my case were randomly Going insert mode, typing, Hitting Undo button, delete a line ... My cursor made some moves to somewhere to the bottom and then comeback to the original position (should be clear when seeing the video)

To Reproduce
Steps to reproduce the behavior:

  1. Open three split windows (neotree - toggleterm - random file)
  2. Interact with the main buffer: Going insert mode, typing, Hitting Undo button, delete a line

Expected behavior
Cursor stay still as a normal neovim would do

Screenshots

bandicam.2024-04-30.14-25-21-495.mp4

Desktop (please complete the following information):

  • Window 11 - WSL2 Ubuntu 22.04
  • Neovide 0.12.2
  • Neovim Version 0.9.5

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

@ThaiDuy12345 ThaiDuy12345 added the bug Something isn't working label Apr 30, 2024
@fredizzimo
Copy link
Member

There's not much we can do about it unfortunately, we have a hack trying to prevent it, but it's not dealing with all situations. It really needs to be fixed on the Neovim side:

@fredizzimo fredizzimo added the neovim-upstream Requires/is blocked on a change in Neovim itself label Apr 30, 2024
@ThaiDuy12345
Copy link
Author

There's not much we can do about it unfortunately, we have a hack trying to prevent it, but it's not dealing with all situations. It really needs to be fixed on the Neovim side:

Is there a temporary way to prevent it? I try to disabled the cursor animation also but it's still there

@fredizzimo
Copy link
Member

Hm, this issue might be a bit different, it looks like grid is modifed

TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 1, row: 24, column_start: 40, cells: [GridLineCell { text: " ", highlight_id: Some(1305), repeat: None }, GridLineCell { text: " ", highlight_id: Some(0), repeat: Some(0) }] }
TRACE [neovide::channel_utils] neovim_handler GridLine { grid: 1, row: 24, column_start: 40, cells: [GridLineCell { text: " ", highlight_id: Some(1257), repeat: None }, GridLineCell { text: " ", highlight_id: Some(0), repeat: Some(0) }] }

That is, it adds a winseparator (highlight id 1305), and then deletes it. I suspect either noice or the other plugin you have at the top with LSP diagnostics info is causing it. Which plugin is that?

@ThaiDuy12345
Copy link
Author

bandicam.2024-04-30.16-12-02-463.mp4

Update: changing vim.opt.laststatus from 3 to 1 work for me and prevent the flicker

@fredizzimo
Copy link
Member

Although I think this is another Neovim spurious cursor movement bug. It seems to move to the separator when the layout changes. I think we might be able to make a workaround in Neovide by debouncing the cursor movements.

We could wait for say 10 ms before moving the cursor. That should be enough for the cursor to move and come back. It adds a very slight extra latency, but 10 ms should not be too bad, and I doubt anyone would notice. This could replace our existing hack.

@ThaiDuy12345
Copy link
Author

Although I think this is another Neovim spurious cursor movement bug. It seems to move to the separator when the layout changes. I think we might be able to make a workaround in Neovide by debouncing the cursor movements.

We could wait for say 10 ms before moving the cursor. That should be enough for the cursor to move and come back. It adds a very slight extra latency, but 10 ms should not be too bad, and I doubt anyone would notice. This could replace our existing hack.

😊 Cool, looking forward to it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working neovim-upstream Requires/is blocked on a change in Neovim itself
Projects
None yet
Development

No branches or pull requests

2 participants