ui_compositior: handle multiple displayed floats in the same tick

problem: the order of non-focuesed float opened before focused float is wrong (sunjon)
solution: check curwin and correct the order (bfredl)
This commit is contained in:
Björn Linse
2021-04-21 10:55:54 +02:00
parent bb7d3790bf
commit eeb1099bc4
3 changed files with 213 additions and 3 deletions

View File

@@ -180,7 +180,8 @@ bool ui_comp_put_grid(ScreenGrid *grid, int row, int col, int height, int width,
if (kv_A(layers, insert_at-1) == &pum_grid && (grid != &msg_grid)) {
insert_at--;
}
if (insert_at > 1 && !on_top) {
if (curwin && kv_A(layers, insert_at-1) == &curwin->w_grid_alloc
&& !on_top) {
insert_at--;
}
// not found: new grid

View File

@@ -772,9 +772,8 @@ void ui_ext_win_position(win_T *wp)
wp->w_winrow = comp_row;
wp->w_wincol = comp_col;
bool valid = (wp->w_redr_type == 0);
bool on_top = (curwin == wp) || !curwin->w_floating;
ui_comp_put_grid(&wp->w_grid_alloc, comp_row, comp_col,
wp->w_height_outer, wp->w_width_outer, valid, on_top);
wp->w_height_outer, wp->w_width_outer, valid, false);
ui_check_cursor_grid(wp->w_grid_alloc.handle);
wp->w_grid_alloc.focusable = wp->w_float_config.focusable;
if (!valid) {