Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.append

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.append
import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { append } = fn;

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>