fix(keys): allow global/local ft keymaps to exist at the same time. Fixes #1241

This commit is contained in:
Folke Lemaitre 2024-01-20 14:11:32 +01:00
parent 747bb955c5
commit 5757b551fc
No known key found for this signature in database
GPG Key ID: 41F8B1FBACAE2040
1 changed files with 5 additions and 0 deletions

View File

@ -41,6 +41,11 @@ function M.parse(value, mode)
ret.mode = mode or "n" ret.mode = mode or "n"
ret.id = vim.api.nvim_replace_termcodes(ret.lhs, true, true, true) ret.id = vim.api.nvim_replace_termcodes(ret.lhs, true, true, true)
if ret.ft then
local ft = type(ret.ft) == "string" and { ret.ft } or ret.ft --[[@as string[] ]]
ret.id = ret.id .. " (" .. table.concat(ft, ", ") .. ")"
end
if ret.mode ~= "n" then if ret.mode ~= "n" then
ret.id = ret.id .. " (" .. ret.mode .. ")" ret.id = ret.id .. " (" .. ret.mode .. ")"
end end