Mercurial > vim
diff runtime/doc/eval.txt @ 23788:d12ef361d9de v8.2.2435
patch 8.2.2435: setline() gives an error for some types
Commit: https://github.com/vim/vim/commit/3445320839a38b3b0c253513b125da8298ec27d6
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 31 13:08:38 2021 +0100
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.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 31 Jan 2021 13:15:04 +0100 |
parents | 34b4eb3a8458 |
children | 525c9e218c69 |
line wrap: on
line diff
--- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1,4 +1,4 @@ -*eval.txt* For Vim version 8.2. Last change: 2021 Jan 22 +*eval.txt* For Vim version 8.2. Last change: 2021 Jan 31 VIM REFERENCE MANUAL by Bram Moolenaar @@ -293,13 +293,13 @@ is not available it returns zero or the 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 ~ @@ -3133,6 +3133,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. Returns 1 for failure ({lnum} out of range or out of memory), 0 for success. Example: > @@ -9409,6 +9410,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.