Skip to main content
Module

x/ddc_vim/deps.ts>fn.setline

Dark deno-powered completion framework for neovim/Vim8
Go to Latest
function fn.setline
import { fn } from "https://deno.land/x/ddc_vim@v2.3.0/deps.ts";
const { setline } = fn;

Set line {lnum} of the current buffer to {text}. To insert lines use |append()|. To set lines in another buffer use |setbufline()|.

{lnum} is used like with |getline()|. When {lnum} is just below the last line the {text} will be added as a new line.

If this succeeds, 0 is returned. If this fails (most likely because {lnum} is invalid) 1 is returned.

Example: :call setline(5, strftime("%c"))

When {text} is a |List| then line {lnum} and following lines will be set to the items in the list. Example: :call setline(5, ['aaa', 'bbb', 'ccc']) This is equivalent to: :for [n, l] in [[5, 'aaa'], [6, 'bbb'], [7, 'ccc']] : call setline(n, l) :endfor

Note: The '[ and '] marks are not set.

Parameters

denops: Denops
lnum: string | number
text: string | string[]

Returns

Promise<boolean>