feat(api): nvim_open_win() relative to tabline and laststatus #32006

Problem:  Anchoring a floating window to the tabline and laststatus is
          cumbersome; requiring autocommands and looping over all
          windows/tabpages.
Solution: Add new "tabline" and "laststatus" options to the `relative`
          field of nvim_open_win() to place a window relative to.
This commit is contained in:
luukvbaal
2025-01-14 14:02:46 +01:00
committed by GitHub
parent e8ddb7a469
commit 25d8c3a5ad
8 changed files with 133 additions and 12 deletions

View File

@@ -307,6 +307,15 @@ void win_check_anchored_floats(win_T *win)
}
}
void win_float_anchor_laststatus(void)
{
FOR_ALL_WINDOWS_IN_TAB(win, curtab) {
if (win->w_config.relative == kFloatRelativeLaststatus) {
win->w_pos_changed = true;
}
}
}
void win_reconfig_floats(void)
{
for (win_T *wp = lastwin; wp && wp->w_floating; wp = wp->w_prev) {