Skip to main content
Module

x/denops_std/function/mod.ts>strdisplaywidth

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

The result is a Number, which is the number of display cells String {string} occupies on the screen when it starts at {col} (first column is zero). When {col} is omitted zero is used. Otherwise it is the screen column where to start. This matters for Tab characters. The option settings of the current window are used. This matters for anything that's displayed differently, such as 'tabstop' and 'display'. When {string} contains characters with East Asian Width Class Ambiguous, this function's return value depends on 'ambiwidth'. Returns zero on error. Also see strlen(), strwidth() and strchars().

Can also be used as a method:

GetText()->strdisplaywidth()

Parameters

denops: Denops
string: unknown
optional
col: unknown

Returns

Promise<number>