Skip to main content
Module

x/denops_std/function/mod.ts>byteidxcomp

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

Like byteidx(), except that a composing character is counted as a separate character. Example: let s = 'e' .. nr2char(0x301) echo byteidx(s, 1) echo byteidxcomp(s, 1) echo byteidxcomp(s, 2) The first and third echo result in 3 ('e' plus composing character is 3 bytes), the second echo results in 1 ('e' is one byte). Only works differently from byteidx() when 'encoding' is set to a Unicode encoding. Can also be used as a |method|: GetName()->byteidxcomp(idx)

Parameters

denops: Denops
expr: unknown
nr: unknown

Returns

Promise<unknown>