Skip to content

Commit 6900d4d

Browse files
committed
feat!: add config.window.overlap.borders
1 parent 3fe9f5e commit 6900d4d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lua/incline/config/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ M.schema = Schema(function(s)
3333
overlap = {
3434
winbar = s:entry(false, vx.bool),
3535
tabline = s:entry(false, vx.bool),
36+
borders = s:entry(false, vx.bool),
3637
},
3738
placement = {
3839
vertical = s:entry('top', vx.any { 'top', 'bottom' }),

lua/incline/winline.lua

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ 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+
72+
-- TODO(willothy): this can obviously be simplified a lot, there is a good bit of repetition
7173
if vim.o.laststatus ~= 3 or a.nvim_win_get_position(self.target_win)[1] <= 1 then
7274
if cw.margin.vertical.top == 0 then
7375
if config.window.overlap.tabline then
@@ -85,7 +87,14 @@ function Winline:get_win_geom_row()
8587
return cw.margin.vertical.top
8688
end
8789
end
88-
return cw.margin.vertical.top - 1
90+
-- only overlap border if user has set it
91+
if config.window.overlap.borders then
92+
return cw.margin.vertical.top - 1
93+
elseif config.window.overlap.winbar == false and vim.wo[self.target_win].winbar ~= '' then
94+
return cw.margin.vertical.top + 1
95+
else
96+
return cw.margin.vertical.top
97+
end
8998
elseif placement.vertical == 'bottom' then
9099
return a.nvim_win_get_height(self.target_win) - cw.margin.vertical.bottom
91100
end

0 commit comments

Comments
 (0)