@@ -2669,8 +2669,9 @@ maparg({name} [, {mode} [, {abbr} [, {dict}]]])
26692669 rhs of mapping {name} in mode {mode}
26702670mapcheck({name} [, {mode} [, {abbr}]])
26712671 String check for mappings matching {name}
2672- mapset({mode}, {abbr}, {dict})
2673- none restore mapping from |maparg()| result
2672+ mapnew({expr1}, {expr2}) List/Dict like |map()| but creates a new List
2673+ or Dictionary
2674+ mapset({mode}, {abbr}, {dict}) none restore mapping from |maparg()| result
26742675match({expr}, {pat} [, {start} [, {count}]])
26752676 Number position where {pat} matches in {expr}
26762677matchadd({group}, {pattern} [, {priority} [, {id} [, {dict}]]])
@@ -6987,9 +6988,14 @@ luaeval({expr} [, {expr}]) *luaeval()*
69876988< {only available when compiled with the |+lua| feature}
69886989
69896990map({expr1}, {expr2}) *map()*
6990- {expr1} must be a |List| or a |Dictionary|.
6991+ {expr1} must be a |List|, |Blob| or |Dictionary|.
69916992 Replace each item in {expr1} with the result of evaluating
6992- {expr2}. {expr2} must be a |string| or |Funcref|.
6993+ {expr2}. For a |Blob| each byte is replaced.
6994+ If the item type changes you may want to use |mapnew()| to
6995+ create a new List or Dictionary. This is required when using
6996+ Vim9 script.
6997+
6998+ {expr2} must be a |string| or |Funcref|.
69936999
69947000 If {expr2} is a |string|, inside {expr2} |v:val| has the value
69957001 of the current item. For a |Dictionary| |v:key| has the key
@@ -7024,11 +7030,11 @@ map({expr1}, {expr2}) *map()*
70247030 |Dictionary| to remain unmodified make a copy first: >
70257031 :let tlist = map(copy(mylist), ' v:val . "\t"')
70267032
7027- < Returns {expr1}, the |List| or |Dictionary| that was filtered.
7028- When an error is encountered while evaluating {expr2} no
7029- further items in {expr1} are processed. When {expr2} is a
7030- Funcref errors inside a function are ignored, unless it was
7031- defined with the "abort" flag.
7033+ < Returns {expr1}, the |List|, |Blob| or |Dictionary| that was
7034+ filtered. When an error is encountered while evaluating
7035+ {expr2} no further items in {expr1} are processed. When
7036+ {expr2} is a Funcref errors inside a function are ignored,
7037+ unless it was defined with the "abort" flag.
70327038
70337039 Can also be used as a |method|: >
70347040 mylist->map(expr2)
@@ -7137,7 +7143,13 @@ mapcheck({name} [, {mode} [, {abbr}]]) *mapcheck()*
71377143 GetKey()->mapcheck('n')
71387144
71397145
7140- mapset({mode}, {abbr}, {dict}) *mapset()*
7146+ mapnew({expr1}, {expr2}) *mapnew()*
7147+ Like |map()| but instead of replacing items in {expr1} a new
7148+ List or Dictionary is created and returned. {expr1} remains
7149+ unchanged.
7150+
7151+
7152+ mapset({mode}, {abbr}, {dict}) *mapset()*
71417153 Restore a mapping from a dictionary returned by |maparg()|.
71427154 {mode} and {abbr} should be the same as for the call to
71437155 |maparg()|. *E460*
0 commit comments