aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-02-27 10:10:42 +0800
committerGitHub <noreply@github.com>2023-02-27 10:10:42 +0800
commit2c9fbe34b20266ef5ab54f6ed14fb38eef60430d (patch)
tree904fd34f9cc1e7846192c8f458b21b23ce40996b /runtime
parentd52a3f7c715cf4e3f2996dc16b405e1a63b7301d (diff)
downloadrneovim-2c9fbe34b20266ef5ab54f6ed14fb38eef60430d.tar.gz
rneovim-2c9fbe34b20266ef5ab54f6ed14fb38eef60430d.tar.bz2
rneovim-2c9fbe34b20266ef5ab54f6ed14fb38eef60430d.zip
vim-patch:8.2.2336: Vim9: not possible to extend dictionary with different type (#22425)
Problem: Vim9: it is not possible to extend a dictionary with different item types. Solution: Add extendnew(). (closes vim/vim#7666) https://github.com/vim/vim/commit/b0e6b513648db7035046613431a4aa9d71ef4653 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/builtin.txt11
-rw-r--r--runtime/doc/usr_41.txt2
2 files changed, 13 insertions, 0 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt
index 35f1b7cd6f..3ff4e47a45 100644
--- a/runtime/doc/builtin.txt
+++ b/runtime/doc/builtin.txt
@@ -138,6 +138,9 @@ expandcmd({string} [, {options}])
String expand {string} like with `:edit`
extend({expr1}, {expr2} [, {expr3}])
List/Dict insert items of {expr2} into {expr1}
+extendnew({expr1}, {expr2} [, {expr3}])
+ List/Dict like |extend()| but creates a new
+ List or Dictionary
feedkeys({string} [, {mode}]) Number add key sequence to typeahead buffer
filereadable({file}) Number |TRUE| if {file} is a readable file
filewritable({file}) Number |TRUE| if {file} is a writable file
@@ -2119,6 +2122,14 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
Can also be used as a |method|: >
mylist->extend(otherlist)
+
+extendnew({expr1}, {expr2} [, {expr3}]) *extendnew()*
+ Like |extend()| but instead of adding items to {expr1} a new
+ List or Dictionary is created and returned. {expr1} remains
+ unchanged. Items can still be changed by {expr2}, if you
+ don't want that use |deepcopy()| first.
+
+
feedkeys({string} [, {mode}]) *feedkeys()*
Characters in {string} are queued for processing as if they
come from a mapping or were typed by the user.
diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt
index 77b1795a57..0f2cfdd2ac 100644
--- a/runtime/doc/usr_41.txt
+++ b/runtime/doc/usr_41.txt
@@ -650,6 +650,7 @@ List manipulation: *list-functions*
insert() insert an item somewhere in a List
add() append an item to a List
extend() append a List to a List
+ extendnew() make a new List and append items
remove() remove one or more items from a List
copy() make a shallow copy of a List
deepcopy() make a full copy of a List
@@ -681,6 +682,7 @@ Dictionary manipulation: *dict-functions*
empty() check if Dictionary is empty
remove() remove an entry from a Dictionary
extend() add entries from one Dictionary to another
+ extendnew() make a new Dictionary and append items
filter() remove selected entries from a Dictionary
map() change each Dictionary entry
keys() get List of Dictionary keys