]> granicus.if.org Git - vim/commitdiff
patch 8.1.2351: 'wincolor' not used for > for not fitting double width char v8.1.2351
authorBram Moolenaar <Bram@vim.org>
Tue, 26 Nov 2019 21:39:10 +0000 (22:39 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 26 Nov 2019 21:39:10 +0000 (22:39 +0100)
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.

src/drawline.c
src/screen.c
src/testdir/dumps/Test_popupwin_doublewidth_1.dump [new file with mode: 0644]
src/version.c

index 54163c7c9402d228e4932d2fa9345e4f4261b4e3..189ed80acc4cee3b6ee7fd8ae8ae55a370ff3c05 100644 (file)
@@ -1230,8 +1230,7 @@ win_line(
                    if (tocol == vcol)
                        tocol += n_extra;
                    // combine 'showbreak' with 'wincolor'
-                   if (win_attr != 0)
-                       char_attr = hl_combine_attr(win_attr, char_attr);
+                   char_attr = hl_combine_attr(win_attr, char_attr);
 #  ifdef FEAT_SYN_HL
                    // combine 'showbreak' with 'cursorline'
                    if (cul_attr != 0)
@@ -1616,6 +1615,8 @@ win_line(
                        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,7 +1791,7 @@ win_line(
                    mb_c = c;
                    mb_utf8 = FALSE;
                    mb_l = 1;
-                   multi_attr = HL_ATTR(HLF_AT);
+                   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;
index c0f7d494bc53f76b6c3475c20d9efc441ff344d4..763d7a82fe2159da133784cf4429079f69abc6c2 100644 (file)
@@ -460,6 +460,18 @@ screen_line(
     }
 #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)
diff --git a/src/testdir/dumps/Test_popupwin_doublewidth_1.dump b/src/testdir/dumps/Test_popupwin_doublewidth_1.dump
new file mode 100644 (file)
index 0000000..d59466d
--- /dev/null
@@ -0,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| 
index 6c9ac22955f65f005257c4a1a79136c12e1a7ce1..ce3b7315686aed6dd212ab0eb89b50eb61a3d161 100644 (file)
@@ -737,6 +737,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2351,
 /**/
     2350,
 /**/