From 9fedb6fd783b9ac48239bc7574779118eec3729a Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 8 Aug 2022 12:08:28 +0800 Subject: vim-patch:8.2.3545: setcellwidths() may make 'listchars' or 'fillchars' invalid Problem: setcellwidths() may make 'listchars' or 'fillchars' invalid. Solution: Check the value and give an error. (closes vim/vim#9024) https://github.com/vim/vim/commit/94358a1e6e640ca5ebeb295efdddd4e92b700673 Cherry-pick f_setcellwidths() change from patch 9.0.0036. Cherry-pick 'ambiwidth' docs update from runtime update 079ba76ae7a7. --- runtime/doc/builtin.txt | 3 +++ runtime/doc/options.txt | 2 ++ 2 files changed, 5 insertions(+) (limited to 'runtime') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index 447f1c89e2..b80bedfac5 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -6837,6 +6837,9 @@ setcellwidths({list}) *setcellwidths()* 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([]); diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index 28922e9c7f..f0977c91de 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -591,6 +591,8 @@ 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. These errors may + also be given when calling setcellwidths(). The values are overruled for characters specified with |setcellwidths()|. -- cgit