fix(toggle): M.wk should not add description if there's a LazyKeysHandler present

This commit is contained in:
Iordanis Petkakis 2024-09-27 18:10:16 +03:00
parent cb40a09538
commit 63b3e6d032

View file

@ -39,9 +39,15 @@ function M.map(lhs, toggle)
end
function M.wk(lhs, toggle)
local keys = require("lazy.core.handler").handlers.keys
---@cast keys LazyKeysHandler
if not LazyVim.has("which-key.nvim") then
return
end
if keys.have and keys:have(lhs, "n") then
return
end
local function safe_get()
local ok, enabled = pcall(toggle.get)
if not ok then