Skip to content

Commit cc961d9

Browse files
committed
fix(ProjectDiffScreen): Account for tabline offset
When showtabline > 0 (tabline visible), floating windows with relative='editor' are offset by 1 row. This caused the "Staged Changes" header to be hidden behind the app bar. Fix by adjusting row position based on showtabline setting.
1 parent dff0061 commit cc961d9

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • lua/vgit/features/screens/ProjectDiffScreen

lua/vgit/features/screens/ProjectDiffScreen/init.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ function ProjectDiffScreen:constructor(opts)
5858
return model:get_diff()
5959
end,
6060
}, {
61-
row = 1,
61+
-- Account for tabline: when showtabline > 0, tabline takes row 0,
62+
-- pushing content down by 1
63+
row = vim.o.showtabline > 0 and 2 or 1,
6264
col = '25vw',
6365
width = '75vw',
6466
}, {
@@ -72,7 +74,9 @@ function ProjectDiffScreen:constructor(opts)
7274
return model:get_entries()
7375
end,
7476
}, {
75-
row = 1,
77+
-- Account for tabline: when showtabline > 0, tabline takes row 0,
78+
-- pushing content down by 1
79+
row = vim.o.showtabline > 0 and 2 or 1,
7680
width = '25vw',
7781
}, {
7882
elements = {

0 commit comments

Comments
 (0)