mirror of
https://github.com/neovim/neovim.git
synced 2025-09-22 11:18:19 +00:00
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.
(cherry picked from commit 51f33ae5c0
)
This commit is contained in:

committed by
zeertzjq

parent
f7e2ad7915
commit
d916d2f876
@@ -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
|
||||
|
Reference in New Issue
Block a user