From 4d3a67cd620152d11ab9b5f5bdd973f84cc2d44b Mon Sep 17 00:00:00 2001 From: skewb1k Date: Sat, 21 Mar 2026 16:00:06 +0000 Subject: 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`. --- test/functional/lua/vim_spec.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'test/functional/lua/vim_spec.lua') diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index 049398fc74..ac40a95c75 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -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) -- cgit