To: vim_dev@googlegroups.com Subject: Patch 8.2.4497 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4497 Problem: Wrong color for half of wide character next to pum scrollbar. Solution: Redraw the screen cell with the right color. (closes #9874) Files: src/screen.c, src/testdir/test_ins_complete.vim, src/testdir/dumps/Test_scrollbar_on_wide_char.dump *** ../vim-8.2.4496/src/screen.c 2022-02-15 16:17:39.496253454 +0000 --- src/screen.c 2022-03-03 11:30:41.938896847 +0000 *************** *** 1495,1502 **** int textlen, int row, int col, ! int attr) { unsigned off; char_u *ptr = text; int len = textlen; --- 1495,1503 ---- int textlen, int row, int col, ! int attr_arg) { + int attr = attr_arg; unsigned off; char_u *ptr = text; int len = textlen; *************** *** 1722,1729 **** --- 1723,1732 ---- if (clear_next_cell) { // This only happens at the end, display one space next. + // Keep the attribute from before. ptr = (char_u *)" "; len = -1; + attr = ScreenAttrs[off]; } } else *** ../vim-8.2.4496/src/testdir/test_ins_complete.vim 2022-02-18 17:50:00.449462055 +0000 --- src/testdir/test_ins_complete.vim 2022-03-03 11:18:32.312012565 +0000 *************** *** 606,611 **** --- 606,629 ---- call delete('Xpreviewscript') endfunc + func Test_scrollbar_on_wide_char() + CheckScreendump + + let lines =<< trim END + call setline(1, ['a', ' 啊啊啊', + \ ' 哦哦哦', + \ ' 呃呃呃']) + call setline(5, range(10)->map({i, v -> 'aa' .. v .. 'bb'})) + END + call writefile(lines, 'Xwidescript') + let buf = RunVimInTerminal('-S Xwidescript', #{rows: 10}) + call term_sendkeys(buf, "A\") + call VerifyScreenDump(buf, 'Test_scrollbar_on_wide_char', {}) + + call StopVimInTerminal(buf) + call delete('Xwidescript') + endfunc + " Test for inserting the tag search pattern in insert mode func Test_ins_compl_tag_sft() call writefile([ *** ../vim-8.2.4496/src/testdir/dumps/Test_scrollbar_on_wide_char.dump 2022-03-03 11:45:32.555167068 +0000 --- src/testdir/dumps/Test_scrollbar_on_wide_char.dump 2022-03-03 11:31:08.190849355 +0000 *************** *** 0 **** --- 1,10 ---- + |a+0&#ffffff0@1|0|b@1> @69 + |a+0#0000001#e0e0e08@1|0|b@1| @9| +0#0000000#0000001|啊*0&#ffffff0| +&@56 + |a+0#0000001#ffd7ff255@1|1|b@1| @9| +0#0000000#0000001| +0&#ffffff0|哦*&| +&@55 + |a+0#0000001#ffd7ff255@1|2|b@1| @9| +0#0000000#0000001|呃*0&#ffffff0@1| +&@54 + |a+0#0000001#ffd7ff255@1|3|b@1| @9| +0#0000000#0000001| +0&#ffffff0@58 + |a+0#0000001#ffd7ff255@1|4|b@1| @9| +0#0000000#0000001| +0&#ffffff0@58 + |a+0#0000001#ffd7ff255@1|5|b@1| @9| +0#0000000#0000001| +0&#ffffff0@58 + |a+0#0000001#ffd7ff255@1|6|b@1| @9| +0#0000000#a8a8a8255| +0&#ffffff0@58 + |a+0#0000001#ffd7ff255@1|7|b@1| @9| +0#0000000#a8a8a8255| +0&#ffffff0@58 + |-+2&&@1| |K|e|y|w|o|r|d| |c|o|m|p|l|e|t|i|o|n| |(|^|N|^|P|)| |m+0#00e0003&|a|t|c|h| |1| |o|f| |1|0| +0#0000000&@32 *** ../vim-8.2.4496/src/version.c 2022-03-03 10:44:13.646217707 +0000 --- src/version.c 2022-03-03 11:23:31.427618241 +0000 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 4497, /**/ -- hundred-and-one symptoms of being an internet addict: 148. You find it easier to dial-up the National Weather Service Weather/your_town/now.html than to simply look out the window. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///