[X] This feature isn't just a vague idea and can have a good practical solution.
[X] I'm completely sure that this feature fits into this plugin.
[x] I'm willing to implement this through a PR.
Problem
It would be nice to be able to click on the directories and have a callback fire
an example use-case would be to open nerdtree or oil.nvim to that directory
Solution Suggestion
adding an additional onClick to the Entry class should be simple,
I'm not sure how you would want to implement it though
the current to = {} stuff could be made generic to to use the same click handlers with a default implementation
configuration could be done pretty simply with a table
function Entry:navigate()
local handler = config.onclick[entry.type] or function (entry)
vim.cmd.mark("'")
vim.api.nvim_set_current_win(entry.to.win)
vim.api.nvim_win_set_cursor(entry.to.win, entry.to.pos)
end
handler(self)
end
require('barbecue').setup({
onclick = {
dir = function (entry)
require('nerdtree').focus(entry.filepath)
end,
}
})
some additional parameters would be required on the Entry to make this useable, like the filepath one above
Requirements
Problem
It would be nice to be able to click on the directories and have a callback fire
an example use-case would be to open nerdtree or oil.nvim to that directory
Solution Suggestion
adding an additional onClick to the Entry class should be simple, I'm not sure how you would want to implement it though
the current
to = {}
stuff could be made generic to to use the same click handlers with a default implementationconfiguration could be done pretty simply with a table
some additional parameters would be required on the Entry to make this useable, like the
filepath
one aboveWorkaround
No response