diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-11-22 06:56:56 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-22 07:11:50 +0800 |
commit | ef5dfe6c652473a8982b93bceebb470c1cee813e (patch) | |
tree | 4ca3244b5123831338fc7b54ac69d542381ca2c5 /runtime | |
parent | 904d0056d520ef01e2873bbaa91a4693e8dfd226 (diff) | |
download | rneovim-ef5dfe6c652473a8982b93bceebb470c1cee813e.tar.gz rneovim-ef5dfe6c652473a8982b93bceebb470c1cee813e.tar.bz2 rneovim-ef5dfe6c652473a8982b93bceebb470c1cee813e.zip |
vim-patch:8.2.2435: setline() gives an error for some types
Problem: setline() gives an error for some types.
Solution: Allow any type, convert each item to a string.
https://github.com/vim/vim/commit/3445320839a38b3b0c253513b125da8298ec27d6
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 3 | ||||
-rw-r--r-- | runtime/doc/eval.txt | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index fa9fb286ae..a6eafbf2b9 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -638,6 +638,7 @@ append({lnum}, {text}) *append()* text line below line {lnum} in the current buffer. Otherwise append {text} as one text line below line {lnum} in the current buffer. + Any type of item is accepted and converted to a String. {lnum} can be zero to insert a line before the first one. {lnum} is used like with |getline()|. Returns 1 for failure ({lnum} out of range or out of memory), @@ -7054,6 +7055,8 @@ setline({lnum}, {text}) *setline()* {lnum} is used like with |getline()|. When {lnum} is just below the last line the {text} will be added below the last line. + {text} can be any type or a List of any type, each item is + converted to a String. If this succeeds, FALSE is returned. If this fails (most likely because {lnum} is invalid) TRUE is returned. diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index e4f8030f16..eb42e10338 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -229,13 +229,13 @@ is not available it returns zero or the default value you specify: > List concatenation ~ - + *list-concatenation* Two lists can be concatenated with the "+" operator: > :let longlist = mylist + [5, 6] :let 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 see |list-modification| below. +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. Sublist ~ |