Skip to main content
Module

x/denops_std/function/cursor.ts>getcurpos

📚 Standard module for denops.vim
Go to Latest
function getcurpos
import { getcurpos } from "https://deno.land/x/denops_std@v4.1.3/function/cursor.ts";

Get the position of the cursor. This is like getpos('.'), but includes an extra item in the list: [bufnum, lnum, col, off, curswant] ~ The "curswant" number is the preferred column when moving the cursor vertically. Also see |getpos()|. This can be used to save and restore the cursor position: let save_cursor = getcurpos() MoveTheCursorAround call setpos('.', save_cursor) Note that this only works within the window. See |winrestview()| for restoring more state.