Skip to content

Commit

Permalink
fix: pass 0 instead of nil for current buffer (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
zeertzjq committed Jan 13, 2022
1 parent 312c386 commit 387fd67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lua/which-key/keys.lua
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ M.mappings = {}
M.duplicates = {}

function M.map(mode, prefix, cmd, buf, opts)
local other = vim.api.nvim_buf_call(buf, function()
local other = vim.api.nvim_buf_call(buf or 0, function()
local ret = vim.fn.maparg(prefix, mode, false, true)
---@diagnostic disable-next-line: undefined-field
return (ret and ret.lhs and ret.rhs ~= cmd) and ret or nil
Expand Down

0 comments on commit 387fd67

Please sign in to comment.