Skip to main content
Module

x/denops_std/function/mod.ts>setcellwidths

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

Specify overrides for cell widths of character ranges. This tells Vim how wide characters are, counted in screen cells. This overrides 'ambiwidth'. Example:

setcellwidths([[0xad, 0xad, 1],
             \ [0x2194, 0x2199, 2]])

The {list} argument is a list of lists with each three numbers. These three numbers are [low, high, width]. "low" and "high" can be the same, in which case this refers to one character. Otherwise it is the range of characters from "low" to "high" (inclusive). "width" is either 1 or 2, indicating the character width in screen cells. An error is given if the argument is invalid, also when a range overlaps with another. Only characters with value 0x100 and higher can be used.

If the new value causes 'fillchars' or 'listchars' to become invalid it is rejected and an error is given.

To clear the overrides pass an empty list:

setcellwidths([]);

You can use the script $VIMRUNTIME/tools/emoji_list.vim to see the effect for known emoji characters.

Parameters

denops: Denops
list: unknown

Returns

Promise<void>