fix(float): update position of anchored windows first (#25133)

This commit is contained in:
zeertzjq
2023-09-14 07:42:22 +08:00
committed by GitHub
parent 77df96f3fb
commit f5953edbac
3 changed files with 200 additions and 4 deletions

View File

@@ -965,7 +965,13 @@ void ui_ext_win_position(win_T *wp, bool validate)
if (c.relative == kFloatRelativeWindow) {
Error dummy = ERROR_INIT;
win_T *win = find_window_by_handle(c.window, &dummy);
if (win) {
api_clear_error(&dummy);
if (win != NULL) {
// When a floating window is anchored to another window,
// update the position of its anchored window first.
if (win->w_pos_changed && win->w_grid_alloc.chars != NULL && win_valid(win)) {
ui_ext_win_position(win, validate);
}
grid = &win->w_grid;
int row_off = 0, col_off = 0;
grid_adjust(&grid, &row_off, &col_off);
@@ -979,7 +985,6 @@ void ui_ext_win_position(win_T *wp, bool validate)
col += tcol - 1;
}
}
api_clear_error(&dummy);
}
wp->w_grid_alloc.zindex = wp->w_float_config.zindex;