import { op } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { ambiwidth } = op;
Only effective when 'encoding' is "utf-8" or another Unicode encoding. Tells Vim what to do with characters with East Asian Width Class Ambiguous (such as Euro, Registered Sign, Copyright Sign, Greek letters, Cyrillic letters).
There are currently two possible values: "single": Use the same width as characters in US-ASCII. This is expected by most users. "double": Use twice the width of ASCII characters.
The value "double" cannot be used if 'listchars' or 'fillchars' contains a character that would be double width. These errors may also be given when calling setcellwidths().
The values are overruled for characters specified with
setcellwidths()
.
There are a number of CJK fonts for which the width of glyphs for those characters are solely based on how many octets they take in legacy/traditional CJK encodings. In those encodings, Euro, Registered sign, Greek/Cyrillic letters are represented by two octets, therefore those fonts have "wide" glyphs for them. This is also true of some line drawing characters used to make tables in text file. Therefore, when a CJK font is used for GUI Vim or Vim is running inside a terminal (emulators) that uses a CJK font (or Vim is run inside an xterm invoked with "-cjkwidth" option.), this option should be set to "double" to match the width perceived by Vim with the width of glyphs in the font. Perhaps it also has to be set to "double" under CJK MS-Windows when the system locale is set to one of CJK locales. See Unicode Standard Annex #11 (http://www.unicode.org/reports/tr11).
Vim may set this option automatically at startup time when Vim is
compiled with the +termresponse
feature and if t_u7
is set to the
escape sequence to request cursor position report. The response can
be found in v:termu7resp
.
(default: "single")