Skip to content

Commit

Permalink
fix(keybinds): use stricter test to determine if keybind was set by user
Browse files Browse the repository at this point in the history
  • Loading branch information
benlubas committed Jul 17, 2024
1 parent efd7bd9 commit 53b5baa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/neorg/modules/core/keybinds/module.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 53b5baa

Please sign in to comment.