]> granicus.if.org Git - vim/commitdiff
patch 8.1.2071: when 'wincolor' is set text property changes highlighting v8.1.2071
authorBram Moolenaar <Bram@vim.org>
Mon, 23 Sep 2019 20:17:15 +0000 (22:17 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 23 Sep 2019 20:17:15 +0000 (22:17 +0200)
Problem:    When 'wincolor' is set text property changes highlighting. (Andy
            Stewart)
Solution:   Fix combining colors. (closes #4968)

src/drawline.c
src/testdir/dumps/Test_wincolor_01.dump
src/testdir/test_highlight.vim
src/version.c

index 5916458be3438c9de91ba6b39597c9f1d8712281..43604c8262725692526e10f4f2aba7ebc3aa5738 100644 (file)
@@ -1367,6 +1367,7 @@ win_line(
 
                text_prop_attr = 0;
                text_prop_combine = FALSE;
+               text_prop_type = NULL;
                if (text_props_active > 0)
                {
                    // Sort the properties on priority and/or starting last.
@@ -1406,8 +1407,11 @@ win_line(
 # ifdef FEAT_TEXT_PROP
            else if (text_prop_type != NULL)
            {
-               char_attr = hl_combine_attr(
-                       line_attr != 0 ? line_attr : win_attr, text_prop_attr);
+               char_attr = hl_combine_attr(line_attr != 0
+                                               ? line_attr
+                                               : syntax_attr != 0
+                                                   ? syntax_attr
+                                                   : win_attr, text_prop_attr);
            }
 # endif
            else if (line_attr != 0 && ((fromcol == -10 && tocol == MAXCOL)
index 06f45b88dd35cba1baaa225c773a36fa6442cd01..5a5ccf506fa7ac0e9782819d944f652f410b59f5 100644 (file)
@@ -1,8 +1,8 @@
 | +0#af5f00255#ffd7ff255@1|2| | +0#0000001&@4| +0&#e0e0e08| +0&#ffd7ff255@64
-| +0#af5f00255&@1|1| |1+0#0000001&@4|1+0#0000000#e0e0e08@4| | +0#0000001#ffd7ff255@59
-| +8#af5f00255&@1|0| |2+0#0000000#e0e0e08@4>2+0#0000001#ffd7ff255@5| +8&&@59
+| +0#af5f00255&@1|1| |1+0#0000001&@4|1+0&#e0e0e08@4| | +0&#ffd7ff255@59
+| +8#af5f00255&@1|0| |2+0#0000001#e0e0e08@4>2+0&#ffd7ff255@5| +8&&@59
 | +0#af5f00255&@1|1| |3+0#0000001&| |h|e|r|e+0&#e0e0e08| +0&#ffd7ff255|3| @62
 | +0#af5f00255&@1|2| | +0#0000001&@4| +0&#e0e0e08| +0&#ffd7ff255@64
+| +0#af5f00255&@1|3| |t+0#40ff4011&|h|e| |c|a+0&#e0e0e08|t+0&#ffd7ff255| |i|s| |o+1&&|u|t| +0&&|o|f| |t|h|e| |b|a|g| +0#0000001&@45
 |~+0#4040ff13&| @73
-|~| @73
 |-+2#0000000#ffffff0@1| |V|I|S|U|A|L| |-@1| +0&&@34|2| @8|3|,|6| @10|A|l@1| 
index 27d7641e44a9e9e1ebec84ea3b37d5e903ef9640..7db33bf30697ca4d8ed50201f6659bc4bbab29cb 100644 (file)
@@ -595,8 +595,13 @@ func Test_wincolor()
 
   let lines =<< trim END
        set cursorline cursorcolumn rnu
-       call setline(1, ["","1111111111","22222222222","3 here 3",""])
+       call setline(1, ["","1111111111","22222222222","3 here 3","","the cat is out of the bag"])
        set wincolor=Pmenu
+       hi CatLine guifg=green ctermfg=green
+       hi Reverse gui=reverse cterm=reverse
+       syn match CatLine /^the.*/
+       call prop_type_add("foo", {"highlight": "Reverse", "combine": 1})
+       call prop_add(6, 12, {"type": "foo", "end_col": 15})
        /here
   END
   call writefile(lines, 'Xtest_wincolor')
index 7f34d2ac9686b76dea42345bd7e787876df57b5d..840c257358bdfeb73e09de2e0bf17f4599631ec3 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2071,
 /**/
     2070,
 /**/