diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-01-14 08:44:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-14 08:44:16 +0800 |
commit | 2bdd8fad4cf4008125ce540453434888c07044a6 (patch) | |
tree | c0140affb2e94410569647fab88e4603774a844a | |
parent | 0c850add3ecedec5b7dea62f0dd152f3421b66fc (diff) | |
download | rneovim-2bdd8fad4cf4008125ce540453434888c07044a6.tar.gz rneovim-2bdd8fad4cf4008125ce540453434888c07044a6.tar.bz2 rneovim-2bdd8fad4cf4008125ce540453434888c07044a6.zip |
docs(builtin): fix mapset() signature (#27008)
-rw-r--r-- | runtime/doc/builtin.txt | 3 | ||||
-rw-r--r-- | runtime/lua/vim/_meta/vimfn.lua | 12 | ||||
-rw-r--r-- | src/nvim/eval.lua | 11 |
3 files changed, 19 insertions, 7 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 5f89082b6f..d85735a008 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -4273,7 +4273,8 @@ mapnew({expr1}, {expr2}) *mapnew()* unchanged. Items can still be changed by {expr2}, if you don't want that use |deepcopy()| first. -mapset({mode}, {abbr}, {dict}) *mapset()* +mapset({mode}, {abbr}, {dict}) +mapset({dict}) *mapset()* Restore a mapping from a dictionary, possibly returned by |maparg()| or |maplist()|. A buffer mapping, when dict.buffer is true, is set on the current buffer; it is up to the caller diff --git a/runtime/lua/vim/_meta/vimfn.lua b/runtime/lua/vim/_meta/vimfn.lua index a763be93b9..f044871601 100644 --- a/runtime/lua/vim/_meta/vimfn.lua +++ b/runtime/lua/vim/_meta/vimfn.lua @@ -5152,6 +5152,12 @@ function vim.fn.maplist() end --- @return any function vim.fn.mapnew(expr1, expr2) end +--- @param mode string +--- @param abbr? any +--- @param dict? any +--- @return any +function vim.fn.mapset(mode, abbr, dict) end + --- Restore a mapping from a dictionary, possibly returned by --- |maparg()| or |maplist()|. A buffer mapping, when dict.buffer --- is true, is set on the current buffer; it is up to the caller @@ -5187,11 +5193,9 @@ function vim.fn.mapnew(expr1, expr2) end --- call mapset(d) --- endfor --- ---- @param mode string ---- @param abbr? any ---- @param dict? any +--- @param dict any --- @return any -function vim.fn.mapset(mode, abbr, dict) end +function vim.fn.mapset(dict) end --- When {expr} is a |List| then this returns the index of the --- first item where {pat} matches. Each item is used as a diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua index 322ab829a0..04d176ad1b 100644 --- a/src/nvim/eval.lua +++ b/src/nvim/eval.lua @@ -6317,6 +6317,13 @@ M.funcs = { mapset = { args = { 1, 3 }, base = 1, + name = 'mapset', + params = { { 'mode', 'string' }, { 'abbr', 'any' }, { 'dict', 'any' } }, + signature = 'mapset({mode}, {abbr}, {dict})', + }, + mapset__1 = { + args = { 1, 3 }, + base = 1, desc = [=[ Restore a mapping from a dictionary, possibly returned by |maparg()| or |maplist()|. A buffer mapping, when dict.buffer @@ -6354,8 +6361,8 @@ M.funcs = { endfor ]=], name = 'mapset', - params = { { 'mode', 'string' }, { 'abbr', 'any' }, { 'dict', 'any' } }, - signature = 'mapset({mode}, {abbr}, {dict})', + params = { { 'dict', 'any' } }, + signature = 'mapset({dict})', }, match = { args = { 2, 4 }, |