Skip to content

Commit

Permalink
fix: don't use default mappings when nil is passed
Browse files Browse the repository at this point in the history
  • Loading branch information
ajitid committed Feb 10, 2022
1 parent ff33d07 commit 9d5e652
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/gitlinker/mappings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ local function set_keymap(mode, keys, mapping_opts)
end

function M.set(mappings)
if mappings == nil then
return
end
mappings = mappings or "<leader>gy"
set_keymap("n", mappings)
set_keymap("v", mappings, { silent = false })
Expand Down

0 comments on commit 9d5e652

Please sign in to comment.