import { fn } from "https://deno.land/x/ddc_vim@v4.1.0/deps.ts";
const { setcellwidths } = fn;
Specify overrides for cell widths of character ranges. This tells Vim how wide characters are when displayed in the terminal, counted in screen cells. The values override 'ambiwidth'. Example:
call setcellwidths([
\ [0x111, 0x111, 1],
\ [0x2194, 0x2199, 2],
\ ])
The {list} argument is a List of Lists with each three numbers: [{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). Only characters with value 0x80 and higher can be used.
{width} must be 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.
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. Move the cursor through the text to check if the cell widths of your terminal match with what Vim knows about each emoji. If it doesn't look right you need to adjust the {list} argument.