-
Notifications
You must be signed in to change notification settings - Fork 36
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
Performance boost with eventignore #80
Comments
Thanks for this! Added in |
This is a great fix. I've noticed seemingly random lagginess on some files. Adding this in fixed that immediately and I get smooth scrolling. |
Was this close to delete this plugin as it was NOT smooth in large files but this config made me continue use it. Thank you :) |
Neoscroll now provides a config option to ignore events while scrolling called From my testing, even if you ignore Lastly, I want to thank @tummetott for opening this issue and providing a solution which I used to implement this feature. |
Hey
When I define the following autocmd:
:autocmd WinScrolled * echom 'scrolled'
and then press
<C-f>
, thenscrolled
is printed ~40 times (this depends on the screen size of course)I have several plugins installed which perform callbacks on the
WinScrolled
event (likenvim-scrollbar
,indent-blankline.nvim
,feline.nvim
). Hence, every registered autocmd for this event is triggered ~40 times when pressing<C-f>
only once.I've experimented with neoscrolls hooks and came up with the following configuration:
It has the effect that for every scroll (no matter which one), the
CursorMoved
andWinScrolled
event are only fired once instead of many times. This reduces my CPU utilization significantly when scrolling.Of course there are also side effects: My scrollbar (rendered by
nvim-scrollbar
) or my line number indicator in the statusline (rendered byfeline.nvim
) is e.g. only upated when the scroll animation finished. However this does not bother me at all since the performance is muuuuuuch better and i'm mostly looking at the code while scrolling.I've seen that there already exists a performance mode in
neoscroll.nvim
, which disables syntax highlighting. This tradeoff however is not for me. It makes me headache when the colors turn off and on 😄So I'm opening this issue in case you're not aware of this trick. Maybe this can be added to the plugin and made configurable somehow? Otherwise i'll just keep it in my dots 🙂
The text was updated successfully, but these errors were encountered: