mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
vim-patch:8.2.1969: Vim9: map() may change the list or dict item type
Problem: Vim9: map() may change the list or dict item type.
Solution: Add mapnew().
ea696852e7
Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
11
runtime/lua/vim/_meta/vimfn.lua
generated
11
runtime/lua/vim/_meta/vimfn.lua
generated
@@ -4922,6 +4922,8 @@ function vim.fn.log10(expr) end
|
||||
--- {expr1} must be a |List|, |Blob| or |Dictionary|.
|
||||
--- Replace each item in {expr1} with the result of evaluating
|
||||
--- {expr2}. For a |Blob| each byte is replaced.
|
||||
--- If the item type changes you may want to use |mapnew()| to
|
||||
--- create a new List or Dictionary.
|
||||
---
|
||||
--- {expr2} must be a |string| or |Funcref|.
|
||||
---
|
||||
@@ -5078,6 +5080,15 @@ function vim.fn.maparg(name, mode, abbr, dict) end
|
||||
--- @return any
|
||||
function vim.fn.mapcheck(name, mode, abbr) end
|
||||
|
||||
--- Like |map()| but instead of replacing items in {expr1} a new
|
||||
--- List or Dictionary is created and returned. {expr1} remains
|
||||
--- unchanged.
|
||||
---
|
||||
--- @param expr1 any
|
||||
--- @param expr2 any
|
||||
--- @return any
|
||||
function vim.fn.mapnew(expr1, expr2) end
|
||||
|
||||
--- Restore a mapping from a dictionary returned by |maparg()|.
|
||||
--- {mode} and {abbr} should be the same as for the call to
|
||||
--- |maparg()|. *E460*
|
||||
|
||||
Reference in New Issue
Block a user