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

x/ddc_vim/deps.ts>fn.screencol

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

The result is a Number, which is the current screen column of the cursor. The leftmost column has number 1. This function is mainly used for testing.

Note: Always returns the current screen column, thus if used in a command (e.g. ":echo screencol()") it will return the column inside the command line, which is 1 when the command is executed. To get the cursor position in the file use one of the following mappings:

nnoremap <expr> GG ":echom " .. screencol() .. "\n"
nnoremap <silent> GG :echom screencol()<CR>
nnoremap GG <Cmd>echom screencol()<CR>

Returns

Promise<number>