This commit is contained in:
Rubin Bhandari 2024-06-05 17:39:31 +02:00 committed by GitHub
commit 2ec64df379
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,56 @@
return {
{
"Bekaboo/dropbar.nvim",
event = "LazyFile",
dependencies = {
"nvim-telescope/telescope-fzf-native.nvim",
},
keys = {
{
"<leader>D",
function()
require("dropbar.api").pick()
end,
desc = "Winbar pick",
},
},
opts = function()
local menu_utils = require("dropbar.utils.menu")
-- Closes all the windows in the current dropbar.
local function close()
local menu = menu_utils.get_current()
while menu and menu.prev_menu do
menu = menu.prev_menu
end
if menu then
menu:close()
end
end
return {
menu = {
preview = false,
keymaps = {
-- Navigate back to the parent menu.
["h"] = "<C-w>q",
-- Expands the entry if possible.
["l"] = function()
local menu = menu_utils.get_current()
if not menu then
return
end
local row = vim.api.nvim_win_get_cursor(menu.win)[1]
local component = menu.entries[row]:first_clickable()
if component then
menu:click_on(component, nil, 1, "l")
end
end,
["q"] = close,
["<esc>"] = close,
},
},
}
end,
},
}