diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-11-25 19:15:05 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-11-25 19:27:38 +0000 |
commit | c5d770d311841ea5230426cc4c868e8db27300a8 (patch) | |
tree | dd21f70127b4b8b5f109baefc8ecc5016f507c91 /runtime/lua/vim/keymap.lua | |
parent | 9be89f131f87608f224f0ee06d199fcd09d32176 (diff) | |
parent | 081beb3659bd6d8efc3e977a160b1e72becbd8a2 (diff) | |
download | rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.gz rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.tar.bz2 rneovim-c5d770d311841ea5230426cc4c868e8db27300a8.zip |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'runtime/lua/vim/keymap.lua')
-rw-r--r-- | runtime/lua/vim/keymap.lua | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/runtime/lua/vim/keymap.lua b/runtime/lua/vim/keymap.lua index 50ca0d2d0e..4c19435ef8 100644 --- a/runtime/lua/vim/keymap.lua +++ b/runtime/lua/vim/keymap.lua @@ -42,12 +42,10 @@ local keymap = {} ---@see |mapcheck()| ---@see |mapset()| function keymap.set(mode, lhs, rhs, opts) - vim.validate({ - mode = { mode, { 's', 't' } }, - lhs = { lhs, 's' }, - rhs = { rhs, { 's', 'f' } }, - opts = { opts, 't', true }, - }) + vim.validate('mode', mode, { 'string', 'table' }) + vim.validate('lhs', lhs, 'string') + vim.validate('rhs', rhs, { 'string', 'function' }) + vim.validate('opts', opts, 'table', true) opts = vim.deepcopy(opts or {}, true) @@ -107,11 +105,9 @@ end ---@param opts? vim.keymap.del.Opts ---@see |vim.keymap.set()| function keymap.del(modes, lhs, opts) - vim.validate({ - mode = { modes, { 's', 't' } }, - lhs = { lhs, 's' }, - opts = { opts, 't', true }, - }) + vim.validate('mode', modes, { 'string', 'table' }) + vim.validate('lhs', lhs, 'string') + vim.validate('opts', opts, 'table', true) opts = opts or {} modes = type(modes) == 'string' and { modes } or modes |