Skip to main content
Module

x/denops_std/function/mod.ts>append

📚 Standard module for denops.vim
Go to Latest
function append
import { append } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

When {text} is a List: Append each item of the List as a 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), 0 for success. When {text} is an empty list zero is returned, no matter the value of {lnum}. In Vim9 script an invalid argument or negative number results in an error. Example:

:let failed = append(line('$'), "# THE END")
:let failed = append(0, ["Chapter 1", "the beginning"])

Can also be used as a method after a List, the base is passed as the second argument:

mylist->append(lnum)

Parameters

denops: Denops
lnum: unknown
text: unknown

Returns

Promise<number>