Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/ddc_vim/deps.ts>fn.strwidth

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

The result is a Number, which is the number of display cells String {string} occupies. A Tab character is counted as one cell, alternatively use |strdisplaywidth()|. When {string} contains characters with East Asian Width Class Ambiguous, this function's return value depends on 'ambiwidth'. Also see |strlen()|, |strdisplaywidth()| and |strchars()|. Can also be used as a |method|: GetString()->strwidth()

Parameters

denops: Denops
string: unknown

Returns

Promise<unknown>