Patch 8.1.2386
Problem:    'wincolor' is not used for 'listchars'.
Solution:   Combine the colors. (closes #5308)
Files:      src/drawline.c, src/testdir/test_highlight.vim,
            src/testdir/dumps/Test_wincolor_lcs.dump


*** ../vim-8.1.2385/src/drawline.c      2019-12-01 18:58:07.610835613 +0100
--- src/drawline.c      2019-12-04 19:02:58.549515331 +0100
***************
*** 1222,1228 ****
                    c_extra = NUL;
                    c_final = NUL;
                    n_extra = (int)STRLEN(sbr);
-                   char_attr = HL_ATTR(HLF_AT);
                    need_showbreak = FALSE;
                    vcol_sbr = vcol + MB_CHARLEN(sbr);
                    // Correct end of highlighted area for 'showbreak',
--- 1222,1227 ----
***************
*** 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)
--- 1229,1235 ----
                    if (tocol == vcol)
                        tocol += n_extra;
                    // combine 'showbreak' with 'wincolor'
!                   char_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT));
  #  ifdef FEAT_SYN_HL
                    // combine 'showbreak' with 'cursorline'
                    if (cul_attr != 0)
***************
*** 1701,1707 ****
                        if (area_attr == 0 && search_attr == 0)
                        {
                            n_attr = n_extra + 1;
!                           extra_attr = HL_ATTR(HLF_8);
                            saved_attr2 = char_attr; // save current attr
                        }
                    }
--- 1700,1707 ----
                        if (area_attr == 0 && search_attr == 0)
                        {
                            n_attr = n_extra + 1;
!                           extra_attr = hl_combine_attr(
!                                                    win_attr, HL_ATTR(HLF_8));
                            saved_attr2 = char_attr; // save current attr
                        }
                    }
***************
*** 1770,1776 ****
                            if (area_attr == 0 && search_attr == 0)
                            {
                                n_attr = n_extra + 1;
!                               extra_attr = HL_ATTR(HLF_8);
                                saved_attr2 = char_attr; // save current attr
                            }
                            mb_c = c;
--- 1770,1777 ----
                            if (area_attr == 0 && search_attr == 0)
                            {
                                n_attr = n_extra + 1;
!                               extra_attr = hl_combine_attr(
!                                                    win_attr, HL_ATTR(HLF_8));
                                saved_attr2 = char_attr; // save current attr
                            }
                            mb_c = c;
***************
*** 1814,1820 ****
                    if (area_attr == 0 && search_attr == 0)
                    {
                        n_attr = n_extra + 1;
!                       extra_attr = HL_ATTR(HLF_AT);
                        saved_attr2 = char_attr; // save current attr
                    }
                    mb_c = c;
--- 1815,1821 ----
                    if (area_attr == 0 && search_attr == 0)
                    {
                        n_attr = n_extra + 1;
!                       extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT));
                        saved_attr2 = char_attr; // save current attr
                    }
                    mb_c = c;
***************
*** 1969,1975 ****
                    if (area_attr == 0 && search_attr == 0)
                    {
                        n_attr = 1;
!                       extra_attr = HL_ATTR(HLF_8);
                        saved_attr2 = char_attr; // save current attr
                    }
                    mb_c = c;
--- 1970,1976 ----
                    if (area_attr == 0 && search_attr == 0)
                    {
                        n_attr = 1;
!                       extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_8));
                        saved_attr2 = char_attr; // save current attr
                    }
                    mb_c = c;
***************
*** 1989,1995 ****
                    if (!attr_pri)
                    {
                        n_attr = 1;
!                       extra_attr = HL_ATTR(HLF_8);
                        saved_attr2 = char_attr; // save current attr
                    }
                    mb_c = c;
--- 1990,1996 ----
                    if (!attr_pri)
                    {
                        n_attr = 1;
!                       extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_8));
                        saved_attr2 = char_attr; // save current attr
                    }
                    mb_c = c;
***************
*** 2127,2133 ****
                            c_extra = lcs_tab2;
                        c_final = lcs_tab3;
                        n_attr = tab_len + 1;
!                       extra_attr = HL_ATTR(HLF_8);
                        saved_attr2 = char_attr; // save current attr
                        mb_c = c;
                        if (enc_utf8 && utf_char2len(c) > 1)
--- 2128,2134 ----
                            c_extra = lcs_tab2;
                        c_final = lcs_tab3;
                        n_attr = tab_len + 1;
!                       extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_8));
                        saved_attr2 = char_attr; // save current attr
                        mb_c = c;
                        if (enc_utf8 && utf_char2len(c) > 1)
***************
*** 2198,2204 ****
                    --ptr;          // put it back at the NUL
                    if (!attr_pri)
                    {
!                       extra_attr = HL_ATTR(HLF_AT);
                        n_attr = 1;
                    }
                    mb_c = c;
--- 2199,2205 ----
                    --ptr;          // put it back at the NUL
                    if (!attr_pri)
                    {
!                       extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT));
                        n_attr = 1;
                    }
                    mb_c = c;
***************
*** 2244,2250 ****
                    if (!attr_pri)
                    {
                        n_attr = n_extra + 1;
!                       extra_attr = HL_ATTR(HLF_8);
                        saved_attr2 = char_attr; // save current attr
                    }
                    mb_utf8 = FALSE;    // don't draw as UTF-8
--- 2245,2251 ----
                    if (!attr_pri)
                    {
                        n_attr = n_extra + 1;
!                       extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_8));
                        saved_attr2 = char_attr; // save current attr
                    }
                    mb_utf8 = FALSE;    // don't draw as UTF-8
***************
*** 2503,2509 ****
                c_final = NUL;
                n_extra = 1;
                n_attr = 2;
!               extra_attr = HL_ATTR(HLF_AT);
            }
            mb_c = c;
            if (enc_utf8 && utf_char2len(c) > 1)
--- 2504,2510 ----
                c_final = NUL;
                n_extra = 1;
                n_attr = 2;
!               extra_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT));
            }
            mb_c = c;
            if (enc_utf8 && utf_char2len(c) > 1)
***************
*** 2517,2523 ****
            if (!attr_pri)
            {
                saved_attr3 = char_attr; // save current attr
!               char_attr = HL_ATTR(HLF_AT); // later copied to char_attr
                n_attr3 = 1;
            }
        }
--- 2518,2524 ----
            if (!attr_pri)
            {
                saved_attr3 = char_attr; // save current attr
!               char_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT));
                n_attr3 = 1;
            }
        }
***************
*** 2725,2731 ****
                    || (n_extra && (c_extra != NUL || *p_extra != NUL))))
        {
            c = lcs_ext;
!           char_attr = HL_ATTR(HLF_AT);
            mb_c = c;
            if (enc_utf8 && utf_char2len(c) > 1)
            {
--- 2726,2732 ----
                    || (n_extra && (c_extra != NUL || *p_extra != NUL))))
        {
            c = lcs_ext;
!           char_attr = hl_combine_attr(win_attr, HL_ATTR(HLF_AT));
            mb_c = c;
            if (enc_utf8 && utf_char2len(c) > 1)
            {
*** ../vim-8.1.2385/src/testdir/test_highlight.vim      2019-11-29 
23:15:22.120220547 +0100
--- src/testdir/test_highlight.vim      2019-12-04 19:04:08.965331698 +0100
***************
*** 620,625 ****
--- 620,647 ----
    call delete('Xtest_wincolor')
  endfunc
  
+ func Test_wincolor_listchars()
+   CheckScreendump
+ 
+   let lines =<< trim END
+       call setline(1, ["one","\t\tsome random text enough long to show 
'extends' and 'precedes' includingnbsps, preceding tabs and trailing spaces   
 ","three"])
+       set wincolor=Todo
+       set nowrap cole=1 cocu+=n
+       set list 
lcs=eol:$,tab:>-,space:.,trail:_,extends:>,precedes:<,conceal:*,nbsp:#
+       call matchadd('Conceal', 'text')
+       normal 2G5zl
+   END
+   call writefile(lines, 'Xtest_wincolorlcs')
+   let buf = RunVimInTerminal('-S Xtest_wincolorlcs', {'rows': 8})
+ 
+   call VerifyScreenDump(buf, 'Test_wincolor_lcs', {})
+ 
+   " clean up
+   call term_sendkeys(buf, "\<Esc>")
+   call StopVimInTerminal(buf)
+   call delete('Xtest_wincolorlcs')
+ endfunc
+ 
  func Test_colorcolumn()
    CheckScreendump
  
*** ../vim-8.1.2385/src/testdir/dumps/Test_wincolor_lcs.dump    2019-12-04 
19:08:09.552641784 +0100
--- src/testdir/dumps/Test_wincolor_lcs.dump    2019-12-04 19:03:07.713492011 
+0100
***************
*** 0 ****
--- 1,8 ----
+ |<+0#4040ff13#ffff4012| +0#0000001&@73
+ 
|-+0#0000e05&@2|>|-@6>s+0#0000001&|o|m|e|.+0#0000e05&|r+0#0000001&|a|n|d|o|m|.+0#0000e05&|*+0#e0e0e08#6c6c6c255|.+0#0000e05#ffff4012|e+0#0000001&|n|o|u|g|h|.+0#0000e05&|l+0#0000001&|o|n|g|.+0#0000e05&|t+0#0000001&|o|.+0#0000e05&|s+0#0000001&|h|o|w|.+0#0000e05&|'+0#0000001&|e|x|t|e|n|d|s|'|.+0#0000e05&|a+0#0000001&|n|d|.+0#0000e05&|'+0#0000001&|p|r|e|c|e|d|e|s|'|.+0#0000e05&|i+0#0000001&|n|c|l|>+0#4040ff13&
+ |<| +0#0000001&@73
+ |~+0#4040ff13&| @73
+ |~| @73
+ |~| @73
+ |~| @73
+ | +0#0000000#ffffff0@56|2|,|3|-|1|7| @7|A|l@1| 
*** ../vim-8.1.2385/src/version.c       2019-12-04 15:11:02.713868713 +0100
--- src/version.c       2019-12-04 18:43:22.293816856 +0100
***************
*** 744,745 ****
--- 744,747 ----
  {   /* Add new patch number below this line */
+ /**/
+     2386,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
183. You move your coffeemaker next to your computer.

 /// Bram Moolenaar -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201912041809.xB4I9Skj032557%40masaka.moolenaar.net.

Raspunde prin e-mail lui