diff --git a/lua/dropbar/menu.lua b/lua/dropbar/menu.lua index 993d18f8..fb6d8f64 100644 --- a/lua/dropbar/menu.lua +++ b/lua/dropbar/menu.lua @@ -942,6 +942,7 @@ function dropbar_menu_t:fuzzy_find_open(opts) local border = win_config.border local has_left_border = false local has_bottom_border = false + local has_top_border = false if type(border) == 'string' then if border ~= 'shadow' and border ~= 'none' then has_left_border = true @@ -953,11 +954,35 @@ function dropbar_menu_t:fuzzy_find_open(opts) has_bottom_border = len_border == 1 and border[1] ~= '' or len_border <= 4 and border[2] ~= '' or border[8] ~= '' + -- remove the top border to avoid overlap with the menu + -- the fzf window will never have a title so it's safe to remove + -- the header unless the border is specified by name + if len_border == 8 then + border[1] = '' + border[2] = '' + border[3] = '' + elseif len_border == 4 then + border[1] = '' + else + -- a single char is repeated, so we create + -- a new array with the char repeated, but + -- the top border removed + local ch = border[1] + for i = 1, 8 do + if i < 4 then + border[i] = '' + else + border[i] = ch + end + end + end end -- make sure that fzf window aligns well with menu window win_config.col = has_left_border and -1 or 0 - win_config.row = self._win_configs.height + (has_bottom_border and 1 or 0) + win_config.row = self._win_configs.height + + (has_bottom_border and 1 or 0) + + (has_top_border and -1 or 0) -- don't show title in the fzf window win_config.title = nil