Skip to main content
Module

x/ddc_vim/deps.ts>fn.getline

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

Without {end} the result is a String, which is line {lnum} from the current buffer. Example: > getline(1) When {lnum} is a String that doesn't start with a digit, line() is called to translate the String into a Number. To get the line under the cursor: > getline(".") When {lnum} is smaller than 1 or bigger than the number of lines in the buffer, an empty string is returned.

When {end} is given the result is a |List| where each item is a line from the current buffer in the range {lnum} to {end}, including line {end}. {end} is used in the same way as {lnum}. Non-existing lines are silently omitted. When {end} is before {lnum} an empty |List| is returned. Example: > :let start = line('.') :let end = search("^$") - 1 :let lines = getline(start, end)

To get lines from another buffer see |getbufline()|

Parameters

denops: Denops
lnum: string | number

Returns

Promise<string>

Parameters

denops: Denops
lnum: string | number
end: string | number

Returns

Promise<string[]>