diff options
author | qeatzy <qeatzy@users.noreply.github.com> | 2024-02-07 17:52:25 +0100 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-02-07 17:56:35 +0100 |
commit | c9c2e2d2ff4429a6b5876ee919f15c1dc0018e86 (patch) | |
tree | a3216c5d0ad713eaec12525f0b0941d942da5431 | |
parent | 1af35631f85d2fcdc83c5d457af8273697f5146a (diff) |
runtime(doc): Clarify list-concatenation a bit more
Make doc list-concatenation more clear as for += and extend().
1. describe `+=` for list-concatenation more accurately
2. add `extend()` example for list-concatenation
3. Fix CI errors for missing helptags reference |+=|
closes: #13983
Signed-off-by: qeatzy <qeatzy@users.noreply.github.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r-- | runtime/doc/eval.txt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 75ea2c7f42..3dbbbeafb2 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 9.1. Last change: 2024 Feb 06 +*eval.txt* For Vim version 9.1. Last change: 2024 Feb 07 VIM REFERENCE MANUAL by Bram Moolenaar @@ -303,7 +303,9 @@ List concatenation ~ *list-concatenation* Two lists can be concatenated with the "+" operator: > :let longlist = mylist + [5, 6] +A list can be concatenated with another one in place using the "+=" operator or |extend()|: > :let mylist += [7, 8] + :call extend(mylist, [7, 8]) To prepend or append an item, turn the item into a list by putting [] around it. To change a list in-place, refer to |list-modification| below. @@ -425,7 +427,8 @@ To change part of a list you can specify the first and last item to be modified. The value must at least have the number of items in the range: > :let list[3:5] = [3, 4, 5] -To add items to a List in-place, you can use the |+=| operator: > +To add items to a List in-place, you can use the += operator +|list-concatenation|: > :let listA = [1, 2] :let listA += [3, 4] < |