Skip to main content
Latest
function fn.virtcol2col
import { fn } from "https://deno.land/x/denops_lsputil@v0.9.4/deps.ts";
const { virtcol2col } = fn;

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>