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
Operate at event buffer level. Be more clever with autocommands.
# Details
Previously all operations assumed only the current buffer was being
interacted with.
This can lead to poor behavior when interacting with multiple markdown
buffers. For instance toggling would only change the current buffer but
a buffer open in a separate window would still be rendered and stop
being updated since enable / disable is a global operation. nvim_cmp
popup windows do not change the current buffer so would trigger a
re-render event though no content actually changes.
To get around this use the buffer from events when making changes.
By applying the validation logic on these buffers we avoid doing work
where previously we were.
To make toggling propagate through all buffers use nvim_list_bufs
method.
Additionally there 2 events the provide information that can be
used to improve rendering.
- ModeChanged tells us the start and end mode which we can use to
avoid re-rendering when the change has no impact. I.e. going from
normal mode to command mode should not do anything.
- WinResized tells us all impacted windows which we can use to re-render
all impacted buffers.
0 commit comments