folke / which-key.nvim

💥 Create key bindings that stick. WhichKey helps you remember your Neovim keymaps, by showing available keybindings in a popup as you type.
Apache License 2.0
5.38k stars 177 forks source link

bug: errr on setup #493

Closed eyalk11 closed 1 year ago

eyalk11 commented 1 year ago

Did you check docs and existing issues?

Neovim version (nvim -v)

0.9.1

Operating system/version

windows

Describe the bug

I do the following setup:

wk=require('which-key')
wk.setup()  
wk.register({
    prefix = "<leader>",
    mode = "v",
})

I get the following on startup

--E5108: Error executing lua ...\.vim\plugged\which-key.nvim/lua/which-key/util.lua:128: errr
--stack traceback:
    --[C]: in function 'error'
    --...\.vim\plugged\which-key.nvim/lua/which-key/util.lua:128: in function 'parse_keys'
    --...\.vim\plugged\which-key.nvim/lua/which-key/keys.lua:425: in function 'update_keymaps'
    --...\.vim\plugged\which-key.nvim/lua/which-key/keys.lua:333: in function 'update'
    --...\.vim\plugged\which-key.nvim/lua/which-key/init.lua:96: in function 'load'

where line 128 is :

  if #notation ~= #internal then
    error('errr')
  end

Steps To Reproduce

As mentioned

Expected Behavior

Worked

Repro

Minimal configuration worked. It might be something in my mapping.

MariaSolOs commented 1 year ago

This isn't a bug. Look at the examples in the README. register takes a table of prefixes to mappings.