]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0716: resetting setcellwidth() doesn't update the screen v9.1.0716
authorKen Takata <kentkt@csc.jp>
Thu, 5 Sep 2024 15:19:34 +0000 (17:19 +0200)
committerChristian Brabandt <cb@256bit.org>
Thu, 5 Sep 2024 15:19:34 +0000 (17:19 +0200)
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>
src/mbyte.c
src/testdir/test_utf8.vim
src/version.c

index d8c47acdd161c7cedbe38c3ea087b1d23fc34e7b..fa67032a6f0ef577143f377bedd13ed28396bff1 100644 (file)
@@ -5644,7 +5644,7 @@ f_setcellwidths(typval_T *argvars, typval_T *rettv UNUSED)
        // 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, typval_T *rettv UNUSED)
     }
 
     vim_free(cw_table_save);
+done:
     changed_window_setting_all();
     redraw_all_later(UPD_CLEAR);
 }
index 0f46240db5aba1fa036781fec050c137c9be6ca2..0314fcdfd270afeb8f4f36f02f97667cc0b7643e 100644 (file)
@@ -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&
 
index 536c1fb03dfc199bfaa72b564503eff9f17a2715..80da0e30a187f4fe0f6363a2e717aeb239571c85 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    716,
 /**/
     715,
 /**/