diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-08 21:20:27 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-08 21:20:27 +0800 |
commit | d36c2fa7137d9e388e1a5d99f42cb11394bc8b77 (patch) | |
tree | 3b1bcf6bbb4d284c385c5afb412869fc993257d0 /runtime | |
parent | a46e6afb8b95229478c5c1fb75e3f1c55991def0 (diff) | |
parent | 603f7bd253e6dd3693e2957f0beb3223945fe705 (diff) | |
download | rneovim-d36c2fa7137d9e388e1a5d99f42cb11394bc8b77.tar.gz rneovim-d36c2fa7137d9e388e1a5d99f42cb11394bc8b77.tar.bz2 rneovim-d36c2fa7137d9e388e1a5d99f42cb11394bc8b77.zip |
Merge pull request #19674 from zeertzjq/vim-8.2.1535
vim-patch:8.2.{1535,1537,3545}: setcellwidths()
Diffstat (limited to 'runtime')
-rw-r--r-- | runtime/doc/builtin.txt | 27 | ||||
-rw-r--r-- | runtime/doc/options.txt | 6 | ||||
-rw-r--r-- | runtime/doc/usr_41.txt | 1 |
3 files changed, 33 insertions, 1 deletions
diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index c56ab70774..b80bedfac5 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -396,6 +396,7 @@ setbufline({expr}, {lnum}, {text}) Number set line {lnum} to {text} in buffer {expr} setbufvar({buf}, {varname}, {val}) set {varname} in buffer {buf} to {val} +setcellwidths({list}) none set character cell width overrides setcharpos({expr}, {list}) Number set the {expr} position to {list} setcharsearch({dict}) Dict set character search from {dict} setcmdpos({pos}) Number set cursor position in command-line @@ -6817,6 +6818,32 @@ setbufvar({buf}, {varname}, {val}) *setbufvar()* third argument: > GetValue()->setbufvar(buf, varname) + +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* + 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([]); + + setcharpos({expr}, {list}) *setcharpos()* Same as |setpos()| but uses the specified column number as the character index instead of the byte index in the line. diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 9d03397821..f0977c91de 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -591,7 +591,11 @@ A jump table for the options with a short description can be found at |Q_op|. "double": Use twice the width of ASCII characters. *E834* *E835* The value "double" cannot be used if 'listchars' or 'fillchars' - contains a character that would be double width. + 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 diff --git a/runtime/doc/usr_41.txt b/runtime/doc/usr_41.txt index 008b9b4e58..bc2f7f077b 100644 --- a/runtime/doc/usr_41.txt +++ b/runtime/doc/usr_41.txt @@ -619,6 +619,7 @@ String manipulation: *string-functions* strchars() length of a string in characters strwidth() size of string when displayed strdisplaywidth() size of string when displayed, deals with tabs + setcellwidths() set character cell width overrides substitute() substitute a pattern match with a string submatch() get a specific match in ":s" and substitute() strpart() get part of a string using byte index |