From d5b5c5a52f3e005b5b57acd4d65c760e5d407f6b Mon Sep 17 00:00:00 2001 From: Will Hopkins Date: Tue, 23 Jan 2024 03:05:15 -0800 Subject: [PATCH] fix(fzf): add vertical offset for complex window borders --- lua/dropbar/menu.lua | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lua/dropbar/menu.lua b/lua/dropbar/menu.lua index 5e552759..ae0f29c6 100644 --- a/lua/dropbar/menu.lua +++ b/lua/dropbar/menu.lua @@ -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