anuvyklack / hydra.nvim

Create custom submodes and menus
1.03k stars 23 forks source link

All Hydra colors except pink cause neovim UI to freeze #84

Open AlexKurisu opened 1 year ago

AlexKurisu commented 1 year ago

For example, the following, when used with https://github.com/rcarriga/nvim-notify and https://github.com/folke/noice.nvim, will not display any notifications while Hydra is active

Hydra({
    name = "TEST",
    mode = "n",
    body = "<Leader>t",
    hint = [[_f_ => Test key]],
    config = {
        color = "red",
        invoke_on_body = true,
    },
    heads = {
        {
            "f",
            function()
                vim.notify("Testing hydra...")
            end,
        },
    },
})
llllvvuu commented 1 year ago

I think this is due to the technique used:

https://github.com/anuvyklack/hydra.nvim/blob/master/CONTRIBUTING.md

Every hydra (except pink) is an infinite chain of <Plug>(...) keybindings.

I do have this problem as well with any plugin that uses autocommands (which is almost all of them). But I'm not sure it can be fixed without an entirely different approach. This approach is an "easy" way to control response to all input. I don't know if it's feasible to switch to the layer approach, because that'd require looping through and remapping every key. But maybe?