diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-09-06 06:52:13 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-06 06:52:13 +0800 |
commit | d60c753cffc4a6e7a33e6c94a6ffbe5bbafad13b (patch) | |
tree | ebf83e37af74300e81fe3f81e4b0f3bbe10e0027 | |
parent | e36e68d35cfa285b28f4c87782311e913a306c92 (diff) | |
download | rneovim-d60c753cffc4a6e7a33e6c94a6ffbe5bbafad13b.tar.gz rneovim-d60c753cffc4a6e7a33e6c94a6ffbe5bbafad13b.tar.bz2 rneovim-d60c753cffc4a6e7a33e6c94a6ffbe5bbafad13b.zip |
vim-patch:9.1.0716: resetting setcellwidth() doesn't update the screen (#30274)
Problem: resetting setcellwidth() doesn't update the screen
Solution: Redraw after clearing the cellwidth table (Ken Takata)
closes: vim/vim#15628
https://github.com/vim/vim/commit/539e9b571ae2a80dfa8a42eb132ad9f65f0bbcbc
Co-authored-by: Ken Takata <kentkt@csc.jp>
-rw-r--r-- | src/nvim/mbyte.c | 3 | ||||
-rw-r--r-- | test/old/testdir/test_utf8.vim | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index 6fd51e773d..07bf574c17 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -2926,7 +2926,7 @@ void f_setcellwidths(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) xfree(cw_table); cw_table = NULL; cw_table_size = 0; - return; + goto done; } // Note: use list_T instead of listitem_T so that TV_LIST_ITEM_NEXT can be used properly below. @@ -3023,6 +3023,7 @@ void f_setcellwidths(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) } xfree(cw_table_save); +done: changed_window_setting_all(); redraw_all_later(UPD_NOT_VALID); } diff --git a/test/old/testdir/test_utf8.vim b/test/old/testdir/test_utf8.vim index 3248dc9d98..f46fb9d744 100644 --- a/test/old/testdir/test_utf8.vim +++ b/test/old/testdir/test_utf8.vim @@ -228,6 +228,9 @@ func Test_setcellwidths() call setcellwidths([[0x2103, 0x2103, 2]]) redraw call assert_equal(19, wincol()) + call setcellwidths([]) + redraw + call assert_equal((aw == 'single') ? 10 : 19, wincol()) endfor set ambiwidth& isprint& |