fix(keys): never lazy-load `<nop>` or empty rhs keymaps

This commit is contained in:
Folke Lemaitre 2024-06-06 09:28:35 +02:00
parent 0fc34a0cf5
commit 3e4c795cec
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 4 additions and 0 deletions

View File

@ -109,6 +109,10 @@ function M:_add(keys)
---@param buf? number
local function add(buf)
if type(keys.rhs) == "string" and (keys.rhs == "" or keys.rhs:lower() == "<nop>") then
return self:_set(keys, buf)
end
vim.keymap.set(keys.mode, lhs, function()
local plugins = self.active[keys.id]