]> granicus.if.org Git - vim/commitdiff
patch 9.0.1171: screen is not redrawn after using setcellwidths() v9.0.1171
authorYasuhiro Matsumoto <mattn.jp@gmail.com>
Tue, 10 Jan 2023 16:03:08 +0000 (16:03 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 10 Jan 2023 16:03:08 +0000 (16:03 +0000)
Problem:    Screen is not redrawn after using setcellwidths().
Solution:   Redraw the screen when the cell widths have changed. (Yasuhiro
            Matsumoto, closes #11800)

src/mbyte.c
src/testdir/dumps/Test_setcellwidths_dump_1.dump [new file with mode: 0644]
src/testdir/dumps/Test_setcellwidths_dump_2.dump [new file with mode: 0644]
src/testdir/test_utf8.vim
src/version.c

index aa2b177ce67264f220f95ba39ee3cc3cff660047..1570cef231240836e15ff71b101e811d47874bee 100644 (file)
@@ -5742,6 +5742,7 @@ f_setcellwidths(typval_T *argvars, typval_T *rettv UNUSED)
     }
 
     vim_free(cw_table_save);
+    redraw_all_later(UPD_CLEAR);
 }
 
     void
diff --git a/src/testdir/dumps/Test_setcellwidths_dump_1.dump b/src/testdir/dumps/Test_setcellwidths_dump_1.dump
new file mode 100644 (file)
index 0000000..0bb2788
--- /dev/null
@@ -0,0 +1,6 @@
+>+0&#ffffff0|D|e|s|k|t|o|p| @66
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|1| @10|A|l@1| 
diff --git a/src/testdir/dumps/Test_setcellwidths_dump_2.dump b/src/testdir/dumps/Test_setcellwidths_dump_2.dump
new file mode 100644 (file)
index 0000000..f7b4b0f
--- /dev/null
@@ -0,0 +1,6 @@
+>+0&#ffffff0| |D|e|s|k|t|o|p| @65
+|~+0#4040ff13&| @73
+|~| @73
+|~| @73
+|~| @73
+| +0#0000000&@56|1|,|1| @10|A|l@1| 
index bb99cb3e60e787af1daf700cadd945affc20698b..935af7ebf72700fbbc57e4c5d959f8ab343c0814 100644 (file)
@@ -2,6 +2,7 @@
  
 source check.vim
 source view_util.vim
+source screendump.vim
 
 " Visual block Insert adjusts for multi-byte char
 func Test_visual_block_insert()
@@ -198,6 +199,22 @@ func Test_setcellwidths()
   call setcellwidths([])
 endfunc
 
+func Test_setcellwidths_dump()
+  CheckRunVimInTerminal
+
+  let lines =<< trim END
+      call setline(1, "\ue5ffDesktop")
+  END
+  call writefile(lines, 'XCellwidths', 'D')
+  let buf = RunVimInTerminal('-S XCellwidths', {'rows': 6})
+  call VerifyScreenDump(buf, 'Test_setcellwidths_dump_1', {})
+
+  call term_sendkeys(buf, ":call setcellwidths([[0xe5ff, 0xe5ff, 2]])\<CR>")
+  call VerifyScreenDump(buf, 'Test_setcellwidths_dump_2', {})
+
+  call StopVimInTerminal(buf)
+endfunc
+
 func Test_print_overlong()
   " Text with more composing characters than MB_MAXBYTES.
   new
index b3efaabc404030352023d7ec8c9359c16ed04e52..da397ee4b4e4b6872a57ff21b30edc7bca0c3cbc 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1171,
 /**/
     1170,
 /**/