Skip to content

Commit 217e0bd

Browse files
fix(stages): correct the top-bottom slot limits (#228)
* fix(#189): correct the top-bottom slot limits Old implementation does not work properly because it - 1. overlaps the global statusline (off by 1 row), bottom limit 2. uses `tabline` option instead of `showtabline`, top limit
1 parent 0f50e89 commit 217e0bd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lua/notify/stages/util.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,13 @@ local function window_intervals(windows, direction, cmp)
8585
end
8686

8787
function M.get_slot_range(direction)
88-
local top = vim.opt.tabline:get() == "" and 0 or 1
88+
local top = vim.opt.showtabline:get() == 0 and 0 or 1
89+
if vim.wo.winbar then
90+
top = top + 1
91+
end
92+
8993
local bottom = vim.opt.lines:get()
90-
- (vim.opt.cmdheight:get() + (vim.opt.laststatus:get() > 0 and 1 or 0))
94+
- (vim.opt.cmdheight:get() + (vim.opt.laststatus:get() > 0 and 1 or 0) + 1)
9195
local left = 1
9296
local right = vim.opt.columns:get()
9397
if M.DIRECTION.TOP_DOWN == direction then
@@ -168,7 +172,7 @@ function M.slot_after_previous(win, open_windows, direction)
168172
return move_slot(
169173
direction,
170174
start,
171-
cur_win_conf[space_key(direction)] + border_padding(direction, cur_win_conf)
175+
cur_win_conf[space_key(direction)] + border_padding(direction, cur_win_conf) / 2
172176
)
173177
end
174178

0 commit comments

Comments
 (0)