mirror of
https://github.com/neovim/neovim.git
synced 2026-03-28 11:22:03 +00:00
feat(lua): replace buffer with buf in vim.keymap.set/del #38360
The `buffer` option remains functional but is now undocumented. Providing both will raise an error. Since providing `buf` was disallowed before, there is no code that will break due to using `buffer` alongside `buf`.
This commit is contained in:
@@ -3178,7 +3178,7 @@ describe('vim.keymap', function()
|
||||
0,
|
||||
exec_lua [[
|
||||
GlobalCount = 0
|
||||
vim.keymap.set('n', 'asdf', function() GlobalCount = GlobalCount + 1 end, {buffer=true})
|
||||
vim.keymap.set('n', 'asdf', function() GlobalCount = GlobalCount + 1 end, {buf=true})
|
||||
return GlobalCount
|
||||
]]
|
||||
)
|
||||
@@ -3188,7 +3188,7 @@ describe('vim.keymap', function()
|
||||
eq(1, exec_lua [[return GlobalCount]])
|
||||
|
||||
exec_lua [[
|
||||
vim.keymap.del('n', 'asdf', {buffer=true})
|
||||
vim.keymap.del('n', 'asdf', {buf=true})
|
||||
]]
|
||||
|
||||
feed('asdf\n')
|
||||
@@ -3201,16 +3201,16 @@ describe('vim.keymap', function()
|
||||
eq(
|
||||
true,
|
||||
exec_lua [[
|
||||
opts = {buffer=true}
|
||||
opts = {buf=true}
|
||||
vim.keymap.set('n', 'asdf', function() end, opts)
|
||||
return opts.buffer
|
||||
return opts.buf
|
||||
]]
|
||||
)
|
||||
eq(
|
||||
true,
|
||||
exec_lua [[
|
||||
vim.keymap.del('n', 'asdf', opts)
|
||||
return opts.buffer
|
||||
return opts.buf
|
||||
]]
|
||||
)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user