From 4c1163619209f76d688f4b73edd3a5739dc28b44 Mon Sep 17 00:00:00 2001 From: "Wansmer (Ivan Smirnov)" Date: Thu, 28 Mar 2024 12:39:57 +0300 Subject: [PATCH] fix: recursion on ctrl-keys mappings --- lua/langmapper/auto.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lua/langmapper/auto.lua b/lua/langmapper/auto.lua index 498c400..f95b232 100644 --- a/lua/langmapper/auto.lua +++ b/lua/langmapper/auto.lua @@ -72,7 +72,9 @@ local function automapping(scope, bufnr) for _, map in ipairs(mappings) do local lhs = u.translate_keycode(map.lhs, lang) for _, mode in ipairs(map.mode) do - if not (map.lhs == lhs or has_map(lhs, mode, mappings)) then + -- Prevent recursion on ctrl-keys. E.g. both layouts contains the same keys. See: #23 + local is_same = vim.startswith(lhs:lower(), '