From 53b5baa7339b7af0fb1a158a60e9a1aca53a98cb Mon Sep 17 00:00:00 2001 From: Ben Lubas Date: Tue, 16 Jul 2024 20:08:21 -0400 Subject: [PATCH] fix(keybinds): use stricter test to determine if keybind was set by user --- lua/neorg/modules/core/keybinds/module.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/neorg/modules/core/keybinds/module.lua b/lua/neorg/modules/core/keybinds/module.lua index ec6a3bbe1..c02e708f6 100644 --- a/lua/neorg/modules/core/keybinds/module.lua +++ b/lua/neorg/modules/core/keybinds/module.lua @@ -129,7 +129,7 @@ module.public = { for _, keybind in ipairs(keybinds) do if vim.fn.hasmapto(keybind[2], mode, false) == 0 - and vim.fn.mapcheck(keybind[1], mode, false):len() == 0 + and vim.fn.maparg(keybind[1], mode, false) ~= "" then local opts = vim.tbl_deep_extend("force", { buffer = buffer }, keybinds.opts or {}) vim.keymap.set(mode, keybind[1], keybind[2], opts) @@ -160,7 +160,7 @@ module.public = { if not bound_keys[mode] or not bound_keys[mode][keybind[1]] then if vim.fn.hasmapto(keybind[2], mode, false) ~= 0 then remaps[keybind[1]] = keybind[2] - elseif vim.fn.mapcheck(keybind[1], mode, false):len() ~= 0 then + elseif vim.fn.maparg(keybind[1], mode, false) ~= "" then conflicts[keybind[1]] = keybind[2] end end