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

x/ddc_vim/deps.ts>fn.cursor

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

Positions the cursor at the column (byte count) {col} in the line {lnum}. The first column is one.

When there is one argument {list} this is used as a List with two, three or four item: [{lnum}, {col}] [{lnum}, {col}, {off}] [{lnum}, {col}, {off}, {curswant}] This is like the return value of getpos() or getcurpos(), but without the first item.

To position the cursor using the character count, use setcursorcharpos().

Does not change the jumplist. {lnum} is used like with getline(), except that if {lnum} is zero, the cursor will stay in the current line. If {lnum} is greater than the number of lines in the buffer, the cursor will be positioned at the last line in the buffer. If {col} is greater than the number of bytes in the line, the cursor will be positioned at the last character in the line. If {col} is zero, the cursor will stay in the current column. If {curswant} is given it is used to set the preferred column for vertical movement. Otherwise {col} is used.

When 'virtualedit' is used {off} specifies the offset in screen columns from the start of the character. E.g., a position within a <Tab> or after the last character. Returns 0 when the position could be set, -1 otherwise.

Can also be used as a method:

GetCursorPos()->cursor()

Parameters

denops: Denops
lnum: number
col: number
optional
off: number

Returns

Promise<number>

Parameters

denops: Denops
list:
[
number,
number,
number,
number,
]

Returns

Promise<number>