Skip to main content
Module

x/ddc_vim/deps.ts>fn.virtcol

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

The result is a Number, which is the screen column of the file position given with {expr}. That is, the last screen position occupied by the character at that position, when the screen would be of unlimited width. When there is a at the position, the returned Number will be the column at the end of the . For example, for a in column 1, with 'ts' set to 8, it returns 8. |conceal| is ignored. For the byte position use |col()|. For the use of {expr} see |col()|. When 'virtualedit' is used {expr} can be [lnum, col, off], where "off" is the offset in screen columns from the start of the character. E.g., a position within a or after the last character. When "off" is omitted zero is used. When Virtual editing is active in the current mode, a position beyond the end of the line can be returned. |'virtualedit'| The accepted positions are: . the cursor position $ the end of the cursor line (the result is the number of displayed characters in the cursor line plus one) 'x position of mark x (if the mark is not set, 0 is returned) v In Visual mode: the start of the Visual area (the cursor is the end). When not in Visual mode returns the cursor position. Differs from |'<| in that it's updated right away. Note that only marks in the current file can be used. Examples: virtcol(".") with text "foo^Lbar", with cursor on the "L", returns 5 virtcol("$") with text "fooLbar", returns 9 virtcol("'t") with text " there", with 't at 'h', returns 6 The first column is 1. 0 is returned for an error. A more advanced example that echoes the maximum length of all lines: echo max(map(range(1, line('$')), "virtcol([v:val, '$'])")) Can also be used as a |method|: GetPos()->virtcol()

Parameters

denops: Denops
expr: string | [number | string, number | string, number]

Returns

Promise<number>