aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-01-18 06:50:22 +0800
committerGitHub <noreply@github.com>2023-01-18 06:50:22 +0800
commitf4e03cbdbc88bd0c1095918df11450c98b729988 (patch)
treef098b79045d4175491f4f2dda32044c817b0e1fd /src/nvim/testdir
parent20b7be2d1024b6e9eac68e0cb92cf663e95e51ca (diff)
downloadrneovim-f4e03cbdbc88bd0c1095918df11450c98b729988.tar.gz
rneovim-f4e03cbdbc88bd0c1095918df11450c98b729988.tar.bz2
rneovim-f4e03cbdbc88bd0c1095918df11450c98b729988.zip
vim-patch:9.0.1212: cannot read back what setcellwidths() has done (#21867)
Problem: Cannot read back what setcellwidths() has done. Solution: Add getcellwidths(). (Kota Kato, closes vim/vim#11837) https://github.com/vim/vim/commit/66bb9ae70f7371456ed76518076d2a344f8ab417 Co-authored-by: Kota Kato <github@kat0h.com>
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_utf8.vim20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_utf8.vim b/src/nvim/testdir/test_utf8.vim
index 9146cf7ab3..255f179fc9 100644
--- a/src/nvim/testdir/test_utf8.vim
+++ b/src/nvim/testdir/test_utf8.vim
@@ -199,6 +199,26 @@ func Test_setcellwidths()
call setcellwidths([])
endfunc
+func Test_getcellwidths()
+ call setcellwidths([])
+ call assert_equal([], getcellwidths())
+
+ let widthlist = [
+ \ [0x1330, 0x1330, 2],
+ \ [9999, 10000, 1],
+ \ [0x1337, 0x1339, 2],
+ \]
+ let widthlistsorted = [
+ \ [0x1330, 0x1330, 2],
+ \ [0x1337, 0x1339, 2],
+ \ [9999, 10000, 1],
+ \]
+ call setcellwidths(widthlist)
+ call assert_equal(widthlistsorted, getcellwidths())
+
+ call setcellwidths([])
+endfunc
+
func Test_setcellwidths_dump()
CheckRunVimInTerminal