To: vim_dev@googlegroups.com Subject: Patch 8.1.2351 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.2351 Problem: 'wincolor' not used for > for not fitting double width char. Also: popup drawn on right half of double width character looks wrong. Solution: Adjust color for > character. Clear left half of double width character if right half is being overwritten. Files: src/drawline.c, src/screen.c, src/testdir/dumps/Test_popupwin_doublewidth_1.dump *** ../vim-8.1.2350/src/drawline.c 2019-11-12 22:33:32.089004066 +0100 --- src/drawline.c 2019-11-26 22:36:47.919799152 +0100 *************** *** 1230,1237 **** if (tocol == vcol) tocol += n_extra; // combine 'showbreak' with 'wincolor' ! if (win_attr != 0) ! char_attr = hl_combine_attr(win_attr, char_attr); # ifdef FEAT_SYN_HL // combine 'showbreak' with 'cursorline' if (cul_attr != 0) --- 1230,1236 ---- if (tocol == vcol) tocol += n_extra; // combine 'showbreak' with 'wincolor' ! char_attr = hl_combine_attr(win_attr, char_attr); # ifdef FEAT_SYN_HL // combine 'showbreak' with 'cursorline' if (cul_attr != 0) *************** *** 1616,1621 **** --- 1615,1622 ---- if (cul_attr) multi_attr = hl_combine_attr(multi_attr, cul_attr); #endif + multi_attr = hl_combine_attr(win_attr, multi_attr); + // put the pointer back to output the double-width // character at the start of the next line. ++n_extra; *************** *** 1790,1796 **** mb_c = c; mb_utf8 = FALSE; mb_l = 1; ! multi_attr = HL_ATTR(HLF_AT); // Put pointer back so that the character will be // displayed at the start of the next line. --ptr; --- 1791,1797 ---- mb_c = c; mb_utf8 = FALSE; mb_l = 1; ! multi_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT)); // Put pointer back so that the character will be // displayed at the start of the next line. --ptr; *** ../vim-8.1.2350/src/screen.c 2019-11-21 17:13:12.628361301 +0100 --- src/screen.c 2019-11-26 22:36:17.303919449 +0100 *************** *** 460,465 **** --- 460,477 ---- } #endif /* FEAT_RIGHTLEFT */ + #ifdef FEAT_TEXT_PROP + // First char of a popup window may go on top of the right half of a + // double-wide character. Clear the left half to avoid it getting the popup + // window background color. + if (coloff > 0 && ScreenLines[off_to] == 0) + { + ScreenLines[off_to - 1] = ' '; + ScreenLinesUC[off_to - 1] = 0; + screen_char(off_to - 1, row, col + coloff - 1); + } + #endif + redraw_next = char_needs_redraw(off_from, off_to, endcol - col); while (col < endcol) *** ../vim-8.1.2350/src/testdir/dumps/Test_popupwin_doublewidth_1.dump 2019-11-26 22:38:29.323399531 +0100 --- src/testdir/dumps/Test_popupwin_doublewidth_1.dump 2019-11-26 22:33:18.528617980 +0100 *************** *** 0 **** --- 1,10 ---- + >x+0&#ffffff0| |你*0#0000001#ffd7ff255|好|,|世|界| +&|-| |>+0#4040ff13&| +0#0000000#ffffff0|好*&|世|界|你|好| +&@47 + |你*&|你*0#0000001#ffd7ff255|好|,|世|界|x+&@3|好*0#0000000#ffffff0|世|界|你|好| +&@48 + |x| |x+0#0000001#ffd7ff255| @12| +0#0000000#ffffff0|好*&|世|界|你|好| +&@47 + |~+0#4040ff13&| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + | +0#0000000&@56|1|,|1| @10|A|l@1| *** ../vim-8.1.2350/src/version.c 2019-11-26 19:33:03.458605263 +0100 --- src/version.c 2019-11-26 22:37:37.911602351 +0100 *************** *** 739,740 **** --- 739,742 ---- { /* Add new patch number below this line */ + /**/ + 2351, /**/ -- hundred-and-one symptoms of being an internet addict: 131. You challenge authority and society by portnuking people /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///