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

x/ddc_vim/deps.ts>fn.setcmdpos

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

Set the cursor position in the command line to byte position {pos}. The first position is 1. Use getcmdpos() to obtain the current position. Only works while editing the command line, thus you must use c_CTRL-\_e, c_CTRL-R_= or c_CTRL-R_CTRL-R with '='. For c_CTRL-\_e and c_CTRL-R_CTRL-R with '=' the position is set after the command line is set to the expression. For c_CTRL-R_= it is set after evaluating the expression but before inserting the resulting text. When the number is too big the cursor is put at the end of the line. A number smaller than one has undefined results. Returns 0 when successful, 1 when not editing the command line.

Can also be used as a method:

GetPos()->setcmdpos()

Parameters

denops: Denops
pos: unknown

Returns

Promise<number>