diff options
| author | jdrouhard <john@drouhard.dev> | 2026-04-12 06:44:35 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-12 07:44:35 -0400 |
| commit | 73cfc3ca03c946c623c700258ec424d004982108 (patch) | |
| tree | c05ad1e8f0c5ecc2ab300f056d12c9673e32b222 /runtime/lua/vim/_meta/api.lua | |
| parent | fa22a78d2a5524839437ad04a4e3ba6ff6633de6 (diff) | |
| download | rneovim-73cfc3ca03c946c623c700258ec424d004982108.tar.gz rneovim-73cfc3ca03c946c623c700258ec424d004982108.tar.bz2 rneovim-73cfc3ca03c946c623c700258ec424d004982108.zip | |
perf(ui): check rectangle intersection when looking for covering grids #38500
Problem:
The ui compositor does not use grid_scroll events when a grid other than
the built in msg_grid exists above the scrolled grid, regardless of
whether it actually intersects the scrolled grid anywhere in the
scrolled region.
When another layer exists at a higher zindex, the ui compositor falls
back to composing every line of the scrolled grid. This is especially
evident when using ui2 which creates a floating window that replaces the
built-in msg_grid. Scrolling around with ui2 enabled has poor
performance because the entire grid is recomposed on every scroll
instead of using grid_scroll.
Solution:
Instead of just checking whether another grid exists at a higher zindex
than curgrid, ensure there's a grid above the curgrid that is positioned
over the particular rectangle of interest, which could be a subrectangle
of the whole grid.
Grids above the curgrid that don't intersect there no longer count as
covering the curgrid, and the compositor can continue to use grid_scroll
scroll events. The floating window created for the command line/messages
with ui2 never intersects with the scrolled region of the main window
grid, which allows performant scrolling with it enabled.
Diffstat (limited to 'runtime/lua/vim/_meta/api.lua')
0 files changed, 0 insertions, 0 deletions