Skip to content

Commit 3fe9f5e

Browse files
committed
fix(will squash): fix edge case 3 and resulting additional ones (oof)
1 parent 7dc24f0 commit 3fe9f5e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

lua/incline/winline.lua

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,21 @@ function Winline:get_win_geom_row()
6868
if placement.vertical == 'top' then
6969
-- if margin-top is 0, avoid overlapping tabline, and avoid overlapping
7070
-- statusline if laststatus is not 3
71-
if cw.margin.vertical.top == 0 and (vim.o.laststatus ~= 3 or a.nvim_win_get_position(self.target_win)[1] <= 1) then
72-
if config.window.overlap.tabline then
73-
return -1
71+
if vim.o.laststatus ~= 3 or a.nvim_win_get_position(self.target_win)[1] <= 1 then
72+
if cw.margin.vertical.top == 0 then
73+
if config.window.overlap.tabline then
74+
return cw.margin.vertical.top - 1
75+
-- only overlap winbar if it exists and is configured to overlap
76+
elseif config.window.overlap.winbar or vim.wo[self.target_win].winbar == '' then
77+
return cw.margin.vertical.top
78+
else
79+
return cw.margin.vertical.top + 1
80+
end
81+
-- ensure we skip the winbar if we are overlapping it
7482
elseif config.window.overlap.winbar or vim.wo[self.target_win].winbar == '' then
75-
return 0
83+
return cw.margin.vertical.top - 1
7684
else
77-
return 1
85+
return cw.margin.vertical.top
7886
end
7987
end
8088
return cw.margin.vertical.top - 1

0 commit comments

Comments
 (0)