mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
vim-patch:c9c2e2d2ff44
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: vim/vim#13983
c9c2e2d2ff
Co-authored-by: qeatzy <qeatzy@users.noreply.github.com>
This commit is contained in:
parent
d75022d205
commit
ceed5739e0
@ -252,7 +252,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.
|
||||
@ -374,7 +376,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]
|
||||
<
|
||||
|
Loading…
Reference in New Issue
Block a user