Skip to main content
Module

x/denops_std/function/mod.ts>virtcol2col

📚 Standard module for denops.vim
Go to Latest
function virtcol2col
import { virtcol2col } from "https://deno.land/x/denops_std@v6.4.0/function/mod.ts";

The result is a Number, which is the byte index of the character in window {winid} at buffer line {lnum} and virtual column {col}.

If buffer line {lnum} is an empty line, 0 is returned.

If {col} is greater than the last virtual column in line {lnum}, then the byte index of the character at the last virtual column is returned.

For a multi-byte character, the column number of the first byte in the character is returned.

The {winid} argument can be the window number or the window-ID. If this is zero, then the current window is used.

Returns -1 if the window {winid} doesn't exist or the buffer line {lnum} or virtual column {col} is invalid.

See also screenpos(), virtcol() and col().

Can also be used as a method:

GetWinid()->virtcol2col(lnum, col)

Parameters

denops: Denops
winid: unknown
lnum: unknown
col: unknown

Returns

Promise<number>