diff options
author | luukvbaal <luukvbaal@gmail.com> | 2025-01-14 14:02:46 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-14 05:02:46 -0800 |
commit | 25d8c3a5ad7e9c5668841e66540ebe34ceda73a7 (patch) | |
tree | 139f1495e3b947676e9f011c50dd6ad525347a01 /src/nvim/winfloat.c | |
parent | e8ddb7a46938f8843abc1c321cfd83cee2ba0020 (diff) | |
download | rneovim-25d8c3a5ad7e9c5668841e66540ebe34ceda73a7.tar.gz rneovim-25d8c3a5ad7e9c5668841e66540ebe34ceda73a7.tar.bz2 rneovim-25d8c3a5ad7e9c5668841e66540ebe34ceda73a7.zip |
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.
Diffstat (limited to 'src/nvim/winfloat.c')
-rw-r--r-- | src/nvim/winfloat.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/winfloat.c b/src/nvim/winfloat.c index 3e791e2beb..d11b965dfc 100644 --- a/src/nvim/winfloat.c +++ b/src/nvim/winfloat.c @@ -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) { |