You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Massive performance improvement, only parse / render visible range
## Details
This is a pretty large overhaul to how events are handled by this plugin.
Instead of parsing & rendering the entire buffer only render the lines
within the neovim viewport + small buffer. This involves putting ranges
on the iter_captures calls as well as when parsing the language trees.
All this logic is centralized in the Context class.
Add a debounce on the updates that defaults to 100ms, users can modify
this if they prefer more frequent udpates, this would impact overall
neovim performance.
The performance is now to the point where doing the Obsidian like
behavior of rendering all lines in insert mode except the line being
modified works really well, I may make this the default experience
in a future update. This does involve adding all the *I events to
our autocommand, I have made this based on the render_modes value
to avoid listening to this events if it is not necessary.
We do parse the ranges more frequently since cursor movements could
put the marks out of range so it's not a complete win in all cases,
worst case being small files that can be contained in the viewport.
Still these are typically so fast anyway that doing it more times
is hard to notice.
0 commit comments