Skip to main content
Module

x/ddc_vim/deps.ts>fn.strchars

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

The result is a Number, which is the number of characters in String {expr}. When {skipcc} is omitted or zero, composing characters are counted separately. When {skipcc} set to 1, Composing characters are ignored. |strcharlen()| always does this. Also see |strlen()|, |strdisplaywidth()| and |strwidth()|. {skipcc} is only available after 7.4.755. For backward compatibility, you can define a wrapper function: if has("patch-7.4.755") function s:strchars(str, skipcc) return strchars(a:str, a:skipcc) endfunction else function s:strchars(str, skipcc) if a:skipcc return strlen(substitute(a:str, ".", "x", "g")) else return strchars(a:str) endif endfunction endif Can also be used as a |method|: GetText()->strchars()

Parameters

denops: Denops
expr: unknown
optional
skipcc: unknown

Returns

Promise<unknown>