diff options
Diffstat (limited to 'runtime/doc/builtin.txt')
-rw-r--r-- | runtime/doc/builtin.txt | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index fdee409639..08c8e2e9d6 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -6921,29 +6921,38 @@ setbufvar({buf}, {varname}, {val}) *setbufvar()* setcellwidths({list}) *setcellwidths()* 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]]) - -< *E1109* *E1110* *E1111* *E1112* *E1113* *E1114* - 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. + 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}]. *E1109* *E1110* + {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). *E1111* *E1114* Only characters with value 0x100 and higher can be used. + {width} must be either 1 or 2, indicating the character width + in screen cells. *E1112* + An error is given if the argument is invalid, also when a + range overlaps with another. *E1113* + 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([]); + To clear the overrides pass an empty {list}: > + call setcellwidths([]) + < You can use the script $VIMRUNTIME/tools/emoji_list.vim to see - the effect for known emoji characters. + 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. + setcharpos({expr}, {list}) *setcharpos()* Same as |setpos()| but uses the specified column number as the |