goolord / alpha-nvim

a lua powered greeter like vim-startify / dashboard-nvim
MIT License
1.82k stars 109 forks source link

Setting button keybinding to "h" persists #153

Closed jtye-dsldhomes closed 1 year ago

jtye-dsldhomes commented 1 year ago

My dashboard.section.buttons.val:

dashboard.section.buttons.val = { dashboard.button("s", " Sync plugins", updates), dashboard.button("m", " Mason", [[Mason]]), dashboard.button("f", " Find files", [[Telescope find_files]]), dashboard.button("r", " Restore session", [[silent! RestoreSession]]), dashboard.button("h", " Harpoon", [[lua require("harpoon.ui").toggle_quick_menu()]]), dashboard.button("w", " Workspaces", [[Telescope workspaces]]), dashboard.button("t", " Telescope", [[Telescope]]), dashboard.button("z", " Full screen", [[lua require("config.functions").ToggleZenMode()]]), dashboard.button("e", " Empty buffer", [[enew]]), dashboard.button("q", " Quit NVIM", [[qa]]), }

It's not a problem with harpoon per se, because if I set any of the buttons to "h", when I load a buffer, pressing h will execute whatever I have configured for that button.

If I change buttons to:

dashboard.button("h", "asdf", [[<cmd>echo 'asdf'<cr>]]),

Pressing h in a buffer will echo 'asdf':

image

goolord commented 1 year ago

the keybindings are buffer local, so that's odd

jtye-dsldhomes commented 1 year ago

This seems to be an issue with the combination of fold-preview.nvim being lazy loaded with packer on "CursorHold". I think keymap-amend.nvim is amending binding whatever alpha sets to h to persist after alpha closes.

axieax commented 1 year ago

I've run into the same issue with leap.nvim s bindings (although not set for some reason). Disabling keymap-amend did not seem to resolve the problem, which is quite odd.