patch 9.1.0716: resetting setcellwidth() doesn't update the screen
Commit:
https://github.com/vim/vim/commit/539e9b571ae2a80dfa8a42eb132ad9f65f0bbcbc
Author: Ken Takata <[email protected]>
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 <[email protected]>
Signed-off-by: Christian Brabandt <[email protected]>
diff --git a/src/mbyte.c b/src/mbyte.c
index d8c47acdd..fa67032a6 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -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);
}
diff --git a/src/testdir/test_utf8.vim b/src/testdir/test_utf8.vim
index 0f46240db..0314fcdfd 100644
--- 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&
diff --git a/src/version.c b/src/version.c
index 536c1fb03..80da0e30a 100644
--- a/src/version.c
+++ b/src/version.c
@@ -704,6 +704,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 716,
/**/
715,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/E1smEQz-00DjWm-Du%40256bit.org.