Skip to content

Commit

Permalink
fix(fzf): add vertical offset for complex window borders
Browse files Browse the repository at this point in the history
  • Loading branch information
willothy committed Jan 23, 2024
1 parent 0c3b4f6 commit d5b5c5a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions lua/dropbar/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,29 @@ function dropbar_menu_t:fuzzy_find_open(opts)
height = 1,
})

-- handle vertical offsets for border
if win_config.border ~= 'none' then
win_config.row = win_config.row + (win_config.anchor == 'SW' and 1 or 0)

-- remove the top border from the fzf window if possible
if type(win_config.border) == 'table' then
if #win_config.border == 8 then
win_config.border[2] = ''
else
for i = 1, 8 do
if i <= 3 then
win_config.border[i] = ''
else
win_config.border[i] = win_config.border[1]
end
end
end
elseif win_config.anchor == 'SW' then
-- add offset if needed
win_config.row = win_config.row + 2
end
end

-- don't show title in the fzf window
win_config.title = nil
win_config.title_pos = nil
Expand Down

0 comments on commit d5b5c5a

Please sign in to comment.