mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-04 18:58:12 +00:00
feat(toggle): add which-key mappings when which-key loads
This commit is contained in:
parent
f540b7b6cc
commit
c9f494bd9a
1 changed files with 4 additions and 2 deletions
|
@ -107,8 +107,10 @@ function Toggle:map(keys, opts)
|
|||
self.opts.map(mode, keys, function()
|
||||
self:toggle()
|
||||
end, opts)
|
||||
if self.opts.which_key and pcall(require, "which-key") then
|
||||
self:_wk(keys, mode)
|
||||
if self.opts.which_key then
|
||||
Snacks.util.on_module("which-key", function()
|
||||
self:_wk(keys, mode)
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue