From 5757b551fc6066d836b9e45f70b41561ca619272 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Sat, 20 Jan 2024 14:11:32 +0100 Subject: [PATCH] fix(keys): allow global/local ft keymaps to exist at the same time. Fixes #1241 --- lua/lazy/core/handler/keys.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua/lazy/core/handler/keys.lua b/lua/lazy/core/handler/keys.lua index e19d6e5..6ca2c50 100644 --- a/lua/lazy/core/handler/keys.lua +++ b/lua/lazy/core/handler/keys.lua @@ -41,6 +41,11 @@ function M.parse(value, mode) ret.mode = mode or "n" 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 ret.id = ret.id .. " (" .. ret.mode .. ")" end