changeset 36098:e7f44fefe14b v9.1.0716

patch 9.1.0716: resetting setcellwidth() doesn't update the screen Commit: https://github.com/vim/vim/commit/539e9b571ae2a80dfa8a42eb132ad9f65f0bbcbc Author: Ken Takata <kentkt@csc.jp> Date: Thu Sep 5 17:19:34 2024 +0200 patch 9.1.0716: resetting setcellwidth() doesn't update the screen Problem: resetting setcellwidth() doesn't update the screen Solution: Redraw after clearing the cellwidth table (Ken Takata) closes: #15628 Signed-off-by: Ken Takata <kentkt@csc.jp> Signed-off-by: Christian Brabandt <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Thu, 05 Sep 2024 17:30:08 +0200
parents 7b9aa561aa0c
children ba74906244a1
files src/mbyte.c src/testdir/test_utf8.vim src/version.c
diffstat 3 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -5644,7 +5644,7 @@ f_setcellwidths(typval_T *argvars, typva
 	// Clearing the table.
 	VIM_CLEAR(cw_table);
 	cw_table_size = 0;
-	return;
+	goto done;
     }
 
     ptrs = ALLOC_MULT(listitem_T *, l->lv_len);
@@ -5756,6 +5756,7 @@ f_setcellwidths(typval_T *argvars, typva
     }
 
     vim_free(cw_table_save);
+done:
     changed_window_setting_all();
     redraw_all_later(UPD_CLEAR);
 }
--- a/src/testdir/test_utf8.vim
+++ b/src/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&
 
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    716,
+/**/
     715,
 /**/
     714,