fix(lua): don't mutate opts parameter of vim.keymap.del (#18227)

`vim.keymap.del` takes an `opts` parameter that lets caller refer to and
delete buffer-local mappings. For some reason the implementation of
`vim.keymap.del` mutates the table that is passed in, setting
`opts.buffer` to `nil`. This is wrong and also undocumented.
This commit is contained in:
Andrey Mishchenko
2022-04-22 20:01:08 -04:00
committed by GitHub
parent 116a3f4683
commit 4e4914ab2e
2 changed files with 33 additions and 1 deletions

View File

@@ -130,7 +130,6 @@ function keymap.del(modes, lhs, opts)
local buffer = false
if opts.buffer ~= nil then
buffer = opts.buffer == true and 0 or opts.buffer
opts.buffer = nil
end
if buffer == false then