-
-
Notifications
You must be signed in to change notification settings - Fork 71
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 flickering issue #63
Comments
Unfortunately I don't get any notification triggering the code action call in a non-lsp buffer. The previous issue was due to a slow SSH connection (AFAIK), is there anything similar about your setup that might cause stuttering on fast re-renders? If you're willing to debug a little, you could try changing how frequently renders occur by editing this line https://github.com/rcarriga/nvim-notify/blob/master/lua/notify/service/init.lua#L25. Current setting is to render every 30ms |
Hey @rcarriga , hmmm I tried playing around with the render and I'm pretty sure it's nothing todo with. The cursor flickering is the same. Nope first time noticing this behavior. I have this vim settings if relevant vim.o.updatetime = 100
vim.o.redrawtime = 1500
vim.o.lazyredraw = true
vim.o.timeout = true
vim.o.ttimeout = true
vim.o.timeoutlen = 500
vim.o.ttimeoutlen = 10
Also I have these cursor related autocmds CursorHold ▏octo://* ▏ lua require'octo'.on_cursor_hold()
CursorHold ▏* ▏ lua require'octo.reviews'.show_review_threads()
CursorHold ▏<buffer=4> ▏ :silent! lua vim.lsp.buf.document_highlight()
CursorHold ▏<buffer=5> ▏ :silent! lua vim.lsp.buf.document_highlight()
CursorHold ▏<buffer=3> ▏ :silent! lua vim.lsp.buf.document_highlight()
CursorHold ▏<buffer=2> ▏ :silent! lua vim.lsp.buf.document_highlight()
CursorHold ▏<buffer=8> ▏ :silent! lua vim.lsp.buf.document_highlight()
CursorHold ▏<buffer=5> ▏ lua require'nvim-treesitter-refactor.highlight_definitions'.highlight_usages(5)
CursorHold ▏<buffer=3> ▏ lua require'nvim-treesitter-refactor.highlight_definitions'.highlight_usages(3)
CursorHold ▏<buffer=2> ▏ lua require'nvim-treesitter-refactor.highlight_definitions'.highlight_usages(2)
CursorHold ▏<buffer=4> ▏ lua require'nvim-treesitter-refactor.highlight_definitions'.highlight_usages(4)
CursorHold ▏<buffer=8> ▏ lua require'nvim-treesitter-refactor.highlight_definitions'.highlight_usages(8)
CursorHold ▏<buffer=171> ▏ lua require'nvim-treesitter-refactor.highlight_definitions'.highlight_usages(171)
CursorHold ▏<buffer=207> ▏ lua require'nvim-treesitter-refactor.highlight_definitions'.highlight_usages(207)
CursorHold ▏<buffer=189> ▏ lua require'nvim-treesitter-refactor.highlight_definitions'.highlight_usages(189)
which I disabled but still |
So if you change the render to happen only once a second, that still flickers? If the render speed has no effect on the window flickering then I'll be very confused as otherwise it's just a regular floating window 😅 The cursor autocmds should have no effect, nvim-notify doesn't change cursor position |
Most likely related NeogitOrg/neogit#220 - still getting the same issue (on wezterm, without tmux or alacritty). |
@tami5 could you please confirm if flickering of cursor occurs when there is only single notification displayed? I have just noticed that it flickers for me only when there is more than one at the time. |
@gegoune Following on with NeogitOrg/neogit#220 (comment) I just realised i pointed you to the wrong line, you actually need to also change https://github.com/rcarriga/nvim-notify/blob/master/lua/notify/service/init.lua#L37 as well sorry 🤦 |
Ah, now I see the difference! Set both to 500 and got that: 500.movBut what might be even more important is the fact that with |
Ah OK so the flickering still happens but slowly which suggests it's a specific action causing the flickering, not just general rendering. If it doesn't happen for using the minimal renderer then my best guess would be something in the default renderer. Sorry I can't test myself since I can't reproduce but you could try removing some of the api calls to remove different parts of the rendering to try pinpoint what might be causing the issue. If the difference doesn't happen for the minimal one could you also try using the |
Will try to bisect default renderer when I get a chance later today. Quickly tested |
Did not have a chance to properly look into bisecting default renderer, tried quickly and was just erroring due to my edits. But what I discovered now is that flickering happens in wezterm even with minimal nvim configuration. But does not happen in terminal.app whether I use my full or minimal config. Also does not happen in kitty at all. I am sure when I first reported that issue I experienced it on alacritty. Perhaps that will allow you to replicate it? Can you think of why different terminals could behave differently? |
Misc performance improvements (some inspired by http://wiki.luajit.org/Numerical-Computing-Performance-Guide) Major one is diffing the window configs before updating to avoid unnecessary rendering. Also switched to mutating existing state in spring rather than creating a new table which reduces number of allocations (one per field window per draw). Should help #63 and potentially #72
OK thanks for that I was able to reproduce with wezterm 😅 Definitely looks to be highly dependent on hardware and the terminal emulator as alacritty and kitty didn't show any for me. Anyway I've added a few performance improvements but the main one avoids unnecessary rendering. It looks like it helps a lot with the flickering but doesn't eliminate it entirely. Unfortunately I think it would be impossible to guarantee there will never be any flickering since it depends on terminal/hardware. |
This is truly amazing! Works so much better already. I will run some more tests later but after quick look flicker seems to be gone! You rock! |
I can confirm that this seems to be gone in my version of Wezterm as well! Thank you for your timely updates on this particular issue @rcarriga and for your work in general on this plugin. It's such an amazing addition to my Neovim workflow 😄 |
I'm probably going to close this unless someone has objections. This entire plugin abuses rendering NeoVim's rendering so as I said I don't think we'll ever get guaranteed perfect rendering and it seems like the worst of it is solved. |
Forgot to report back: would still get flicker on occasion but nothing major in terms of frequency. So good to close as far as I am concern. Out of interest, what do you mean by saying "abuses vim's rendering"? |
I mean I don't think that NeoVim's rendering is designed to redraw multiple windows and redefining multiple highlights 30 times a second 😅 Though there are performance improvements being made by the core team (e.g. lua controlled highlights) that will continue to make it more performant |
I'm still facing this issue. Changing the render option doesn't help. The only thing that helps is using |
This is not something that will ever be 100% fixed, it's dependent on the performance of the terminal/GUI. Kitty seems to be the least problematic terminal. |
I've found alacritty to be faster than most terminals I've tried. I don't wanna switch to kitty (because it has a couple of missing features & the author can be very abusive when they're requested). Are there any vim/plugin settings you'd like me to try which can help with this issue? Or perhaps you know why kitty is more performant than alacritty in this case? |
It's hard to pinpoint what will make the difference. The fps, stages and render are the The underlying issue is just that nvim-notify works by constantly updating |
I'm hoping alacritty/alacritty#5843 will reduce the issues. |
I can confirm as well that I had this problem with alactritty, but with kitty I don't. I had it with the default mac terminal as well. |
Just reporting in that I am having the same problem in Warp Terminal. When I use Kitty the flickering is gone. |
Only for the sake of reporting: same problem with iTerm2 on MacOS. I don't care so much about smooth transitions, so I also set |
When ever a new notification is displayed the cursor flickers for the length of the message.
Reproduce
lua vim.lsp.buf.code_action()
on a buffer that doesn't support lsp.The text was updated successfully, but these errors were encountered: