I have a similar requirement, is there a way: When I cycle through buffers, the menu stays pinned; then I use vim.fn.timer_start to unpin it. This way, I can make the menu visible only when cycling through buffers and collapse it at other times.
Or in another case: collapse the menu when the CursorMoved or InsertEnter event is triggered, and expand it when the CursorHold or InsertLeave event occurs.
ps: current api expand_menu()/collapse_menu() can not meet my requirement, I don't know why.
local collapse_timer = nil
vim.keymap.set("n", "<M-b>", function()
if collapse_timer then
vim.fn.timer_stop(collapse_timer)
end
require("bento.ui").expand_menu()
vim.cmd.bnext()
collapse_timer = vim.fn.timer_start(3000, function()
require("bento.ui").collapse_menu()
end)
end)
I have a similar requirement, is there a way: When I cycle through buffers, the menu stays pinned; then I use
vim.fn.timer_startto unpin it. This way, I can make the menu visible only when cycling through buffers and collapse it at other times.Or in another case: collapse the menu when the
CursorMovedorInsertEnterevent is triggered, and expand it when theCursorHoldorInsertLeaveevent occurs.ps: current api
expand_menu()/collapse_menu()can not meet my requirement, I don't know why.