Skip to main content
Module

x/ddc_vim/deps.ts>fn.getpos

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

Get the position for {expr}. For possible values of {expr} see |line()|. For getting the cursor position see |getcurpos()|. The result is a |List| with four numbers: [bufnum, lnum, col, off] "bufnum" is zero, unless a mark like '0 or 'A is used, then it is the buffer number of the mark. "lnum" and "col" are the position in the buffer. The first column is 1. The "off" number is zero, unless 'virtualedit' is used. Then it is the offset in screen columns from the start of the character. E.g., a position within a or after the last character. Note that for '< and '> Visual mode matters: when it is "V" (visual line mode) the column of '< is zero and the column of '> is a large number. This can be used to save and restore the position of a mark: let save_a_mark = getpos("'a") ... call setpos("'a", save_a_mark) Also see |getcurpos()| and |setpos()|. Can also be used as a |method|: GetMark()->getpos()

Parameters

denops: Denops
expr: string