]> granicus.if.org Git - vim/commitdiff
patch 8.1.2241: match highlight does not combine with 'wincolor' v8.1.2241
authorBram Moolenaar <Bram@vim.org>
Sat, 2 Nov 2019 21:00:15 +0000 (22:00 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 2 Nov 2019 21:00:15 +0000 (22:00 +0100)
Problem:    Match highlight does not combine with 'wincolor'.
Solution:   Apply 'wincolor' last on top of any other attribute. (closes #5159)

src/drawline.c
src/testdir/dumps/Test_popupwin_matches.dump
src/testdir/dumps/Test_popupwin_menu_01.dump
src/testdir/dumps/Test_popupwin_menu_02.dump
src/testdir/dumps/Test_popupwin_menu_04.dump
src/testdir/test_popupwin.vim
src/version.c

index 7caba051b6ce868070405a94f64e85f3f33a9a55..dcfe92cc6e6ee976d8c87ff6551de4b7691c062c 100644 (file)
@@ -751,8 +751,6 @@ win_line(
        win_attr = wcr_attr;
        area_highlighting = TRUE;
     }
-    if (vi_attr != 0 && win_attr != 0)
-       vi_attr = hl_combine_attr(win_attr, vi_attr);
 
 #ifdef FEAT_TEXT_PROP
     if (WIN_IS_POPUP(wp))
@@ -1444,10 +1442,6 @@ win_line(
                        prev_syntax_attr = syntax_attr;
                    }
 
-                   // combine syntax attribute with 'wincolor'
-                   if (syntax_attr != 0 && win_attr != 0)
-                       syntax_attr = hl_combine_attr(win_attr, syntax_attr);
-
                    if (did_emsg)
                    {
                        wp->w_s->b_syn_error = TRUE;
@@ -1548,8 +1542,15 @@ win_line(
 #endif
            }
        }
-       if (char_attr == 0)
-           char_attr = win_attr;
+
+       // combine attribute with 'wincolor'
+       if (win_attr != 0)
+       {
+           if (char_attr == 0)
+               char_attr = win_attr;
+           else
+               char_attr = hl_combine_attr(win_attr, char_attr);
+       }
 
        // Get the next character to put on the screen.
 
@@ -3140,4 +3141,3 @@ win_line(
     vim_free(p_extra_free);
     return row;
 }
-
index ba3e720254c4d7778b03c1725ec8f3620ca5036e..6d9faf347209c9da7c118daa09b87e46805b1fd5 100644 (file)
@@ -1,8 +1,8 @@
 |1+0#ffffff16#e000002@2| +0#0000000#ffffff0|2@2| |3@2| @63
->4+0#ffffff16#e000002@2| +0#0000000#ffffff0|5@2| |6+0&#ffff4012@2| +0&#ffffff0@63
+>4+0#4040ff13&@2| +0#0000000&|5@2| |6+0&#ffff4012@2| +0&#ffffff0@63
 |~+0#4040ff13&| @7|╔+0#0000001#ffd7ff255|═@10|╗| +0#4040ff13#ffffff0@52
 |~| @7|║+0#0000001#ffd7ff255|1+0#ffffff16#e000002@2| +0#0000001#ffd7ff255|2@2| |3@2|║| +0#4040ff13#ffffff0@52
-|~| @7|║+0#0000001#ffd7ff255|4@2| |5+0#ffffff16#e000002@2| +0#0000001#ffd7ff255|6@2|║| +0#4040ff13#ffffff0@52
+|~| @7|║+0#0000001#ffd7ff255|4@2| |5+0#4040ff13&@2| +0#0000001&|6@2|║| +0#4040ff13#ffffff0@52
 |~| @7|╚+0#0000001#ffd7ff255|═@10|╝| +0#4040ff13#ffffff0@52
 |~| @73
 |~| @73
index 3f09f3e08a26b28c696c2d625fc3a588b3fbbf28..b41b39829b8cdfa9aa30a7289e40b1b44a86ce4f 100644 (file)
@@ -1,7 +1,7 @@
 >1+0&#ffffff0| @73
 |2| @73
 |3| @20|╔+0#0000001#ffd7ff255| |m|a|k|e| |a| |c|h|o|i|c|e| |f|r|o|m| |t|h|e| |l|i|s|t| |╗| +0#0000000#ffffff0@21
-|4| @20|║+0#0000001#ffd7ff255| |o+0#0000000#5fd7ff255|n|e| +0#0000001&@23| +0&#ffd7ff255|║| +0#0000000#ffffff0@21
+|4| @20|║+0#0000001#ffd7ff255| |o+0&#5fd7ff255|n|e| @23| +0&#ffd7ff255|║| +0#0000000#ffffff0@21
 |5| @20|║+0#0000001#ffd7ff255| |t|w|o| @24|║| +0#0000000#ffffff0@21
 |6| @20|║+0#0000001#ffd7ff255| |a|n|o|t|h|e|r| @20|║| +0#0000000#ffffff0@21
 |7| @20|╚+0#0000001#ffd7ff255|═@28|╝| +0#0000000#ffffff0@21
index 464e276434a93d543c8a0aa8449a60f5107555a8..b7a40e81daca2e2156e8d22823817d49eb91d798 100644 (file)
@@ -3,7 +3,7 @@
 |3| @20|╔+0#0000001#ffd7ff255| |m|a|k|e| |a| |c|h|o|i|c|e| |f|r|o|m| |t|h|e| |l|i|s|t| |╗| +0#0000000#ffffff0@21
 |4| @20|║+0#0000001#ffd7ff255| |o|n|e| @24|║| +0#0000000#ffffff0@21
 |5| @20|║+0#0000001#ffd7ff255| |t|w|o| @24|║| +0#0000000#ffffff0@21
-|6| @20|║+0#0000001#ffd7ff255| |a+0#0000000#5fd7ff255|n|o|t|h|e|r| +0#0000001&@19| +0&#ffd7ff255|║| +0#0000000#ffffff0@21
+|6| @20|║+0#0000001#ffd7ff255| |a+0&#5fd7ff255|n|o|t|h|e|r| @19| +0&#ffd7ff255|║| +0#0000000#ffffff0@21
 |7| @20|╚+0#0000001#ffd7ff255|═@28|╝| +0#0000000#ffffff0@21
 |8| @73
 |9| @73
index 30706a76cd020915e7630ca244688330d051c23a..2ee61fc2472509a1da9a2fa50371c0a8bc2ab855 100644 (file)
@@ -1,7 +1,7 @@
 >1+0&#ffffff0| @73
 |2| @73
 |3| @31|╔+0#0000001#ffd7ff255|═@6|╗| +0#0000000#ffffff0@32
-|4| @31|║+0#0000001#ffd7ff255| |o+0#0000000#40ff4011|n|e| +0#0000001&@1| +0&#ffd7ff255|║| +0#0000000#ffffff0@32
+|4| @31|║+0#0000001#ffd7ff255| |o+0&#40ff4011|n|e| @1| +0&#ffd7ff255|║| +0#0000000#ffffff0@32
 |5| @31|║+0#0000001#ffd7ff255| |t|w|o| @2|║| +0#0000000#ffffff0@32
 |6| @31|║+0#0000001#ffd7ff255| |t|h|r|e@1| |║| +0#0000000#ffffff0@32
 |7| @31|╚+0#0000001#ffd7ff255|═@6|╝| +0#0000000#ffffff0@32
index 2dcd14d376308104a9d8ad30a2cc1f8c0d8c2094..2c4da0b794c67ee0437ac89ac6756d5b6ea1f853 100644 (file)
@@ -249,11 +249,12 @@ func Test_popup_with_matches()
            \ '444 555 666',
            \], #{line: 3, col: 10, border: []})
        set hlsearch
+       hi VeryBlue ctermfg=blue guifg=blue
        /666
        call matchadd('ErrorMsg', '111')
-       call matchadd('ErrorMsg', '444')
+       call matchadd('VeryBlue', '444')
        call win_execute(winid, "call matchadd('ErrorMsg', '111')")
-       call win_execute(winid, "call matchadd('ErrorMsg', '555')")
+       call win_execute(winid, "call matchadd('VeryBlue', '555')")
   END
   call writefile(lines, 'XtestPopupMatches')
   let buf = RunVimInTerminal('-S XtestPopupMatches', #{rows: 10})
index bd0390ace83ca22e0585c464101c6aadde508c02..c5976759b0365db4966e1f1289edb537f72556d0 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2241,
 /**/
     2240,
 /**/