Skip to content

bug: which-key hydra mode not working? #906

@ingenarel

Description

@ingenarel

Did you check docs and existing issues?

  • I have read all the which-key.nvim docs
  • I have updated the plugin to the latest version before submitting this issue
  • I have searched the existing issues of which-key.nvim
  • I have searched the existing issues of plugins related to this issue

Neovim version (nvim -v)

NVIM v0.11.0-dev-1315+g668d2569b4

Operating system/version

linux

Describe the bug

the docs tell me to do this:

require("which-key").show({
    keys = "<c-w>",                                                                                                                       
    loop = true, -- this will keep the popup open until you hit <esc>                                                                     
})

but when i actually put in my config, i get this error:

Error detected while processing /home/ingenarel/.config/nvim/init.lua:                                                                          
E5113: Error while calling lua chunk: .../share/nvim/plugged/which-key.nvim/lua/which-key/buf.lua:69: attempt to index field 'modes' (a nil valu
e)                                                                                                                                              
stack traceback:                                                                                                                                
        .../share/nvim/plugged/which-key.nvim/lua/which-key/buf.lua:69: in function 'attach'                                                    
        .../share/nvim/plugged/which-key.nvim/lua/which-key/buf.lua:138: in function 'update'                                                   
        .../share/nvim/plugged/which-key.nvim/lua/which-key/buf.lua:52: in function 'new'                                                       
        .../share/nvim/plugged/which-key.nvim/lua/which-key/buf.lua:188: in function 'get'                                                      
        ...hare/nvim/plugged/which-key.nvim/lua/which-key/state.lua:288: in function 'start'                                                    
        ...share/nvim/plugged/which-key.nvim/lua/which-key/init.lua:18: in function 'show'                                                      
        .../ingenarel/.config/nvim/lua/_plugins_/_load-plugins_.lua:91: in main chunk                                                           
        [C]: in function 'require'                                                                                                              
        /home/ingenarel/.config/nvim/init.lua:103: in main chunk

Steps To Reproduce

copy paste this in the config:

require("which-key").show({
    keys = "<c-w>",                                                                                                                       
    loop = true, -- this will keep the popup open until you hit <esc>                                                                     
})

Expected Behavior

the error shouldn't happen?

Health

No response

Log

No response

Repro

vim.env.LAZY_STDPATH = ".repro"
load(vim.fn.system("curl -s https://raw.githubusercontent.com/folke/lazy.nvim/main/bootstrap.lua"))()

require("lazy.minit").repro({
  spec = {
    { "folke/which-key.nvim", opts = {} },
    -- add any other plugins here
  },
})
require("which-key").show({
    keys = "<c-w>",                                                                                                                       
    loop = true, -- this will keep the popup open until you hit <esc>                                                                     
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstaleThis issue or PR has been inactive for a while

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions