feat(ui): indicate margins for the area used by win_viewport

Problem: using win_viewport for implementing smooth scrolling in an external
UI might run into problems when winbar or borders is used, as there is
no indication that the entire grid is not used for scrolled buffer text.

Solution: add `win_viewport_margins` event.
This commit is contained in:
bfredl
2024-03-28 15:27:32 +01:00
parent e2224a7933
commit 2e4e12756a
6 changed files with 68 additions and 2 deletions

View File

@ -6744,6 +6744,13 @@ void win_set_inner_size(win_T *wp, bool valid_cursor)
wp->w_width_outer = (wp->w_width_inner + win_border_width(wp));
wp->w_winrow_off = wp->w_border_adj[0] + wp->w_winbar_height;
wp->w_wincol_off = wp->w_border_adj[3];
if (ui_has(kUIMultigrid)) {
ui_call_win_viewport_margins(wp->w_grid_alloc.handle, wp->handle,
wp->w_winrow_off, wp->w_border_adj[2],
wp->w_wincol_off, wp->w_border_adj[1]);
}
wp->w_redr_status = true;
}