mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
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:
@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user