This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-07
Channels
- # announcements (2)
- # babashka (34)
- # beginners (114)
- # biff (7)
- # calva (16)
- # cider (2)
- # clj-kondo (46)
- # clj-on-windows (14)
- # clojars (13)
- # clojure (33)
- # clojure-europe (17)
- # clojure-nl (2)
- # clojure-norway (8)
- # clojure-spec (3)
- # clojure-uk (3)
- # clojurescript (25)
- # community-development (1)
- # datalevin (1)
- # emacs (53)
- # fulcro (31)
- # gratitude (2)
- # jobs (1)
- # lambdaisland (12)
- # lsp (57)
- # malli (3)
- # nbb (1)
- # off-topic (92)
- # pathom (2)
- # pedestal (2)
- # releases (5)
- # shadow-cljs (25)
- # sql (3)
- # squint (1)
- # testing (6)
- # vim (11)
Has anyone else noticed :WhichKey '<LocalLeader>'
bombing out with errors like these?
Error detected while processing function which_key#start[20]..<SNR>159_cache_key[4]..which_key#mappings#parse:
line 19:
E716: Key not present in Dictionary: "rhs])"
E116: Invalid arguments for function call
line 28:
E716: Key not present in Dictionary: "rhs, '<SID>', '<SNR>'.mapd['sid'].'_', 'g')"
E116: Invalid arguments for function substitute
line 36:
E716: Key not present in Dictionary: "display !~# 'WhichKey.*'"
line 19:
E716: Key not present in Dictionary: "rhs])"
E116: Invalid arguments for function call
line 28:
E716: Key not present in Dictionary: "rhs, '<SID>', '<SNR>'.mapd['sid'].'_', 'g')"
E116: Invalid arguments for function substitute
line 36:
E716: Key not present in Dictionary: "display !~# 'WhichKey.*'"
line 19:
E716: Key not present in Dictionary: "rhs])"
E116: Invalid arguments for function call
(It goes on for a few pages.)
I'm guessing it's due to Conjure creating mappings directly (somehow) to Lua functions:
:map <LocalLeader>
...
n <BS>rc *@<Lua function 435>
Clear the refresh cache
n <BS>ra *@<Lua function 434>
Refresh all namespaces
n <BS>rr *@<Lua function 433>
Refresh changed namespaces
...
Internally, vim converts leader to the leader key at read time so internally itโs not <leader>ff, itโs \ff
Is that the case here?
Closest I can get which-key.nvim to behave like vim-which-key, is to add nnoremap <silent> <LocalLeader> :WhichKey '<LocalLeader>'<CR>
, even though the README specifically says not to
Oh well, I guess that half-working hack with which-key-nvim is better than half-broken vim-which-key :man-shrugging: ๐
This is because Neovim has direct to Lua function mappings now which lack the RHS portion of the mapping data. So plugins that try to access that blindly will now throw on ANY Neovim mapping that points at a Lua function. The old which key needs a safe check to support nil RHS or you can use the nvim / new one. If Conjure didn't trigger this bug, some other plugin would eventually, I'm just hopping on the Lua mapping train early because it's so much better and allowed me to fix bugs with vim repeat integration.