summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-02 22:00:15 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-02 22:00:15 +0100
commit024dbd229fa7991b7bf7ef4d0888b43ab03783f7 (patch)
treed12b2978dd45ca333c33cc5d3e47d2d3ce9bf4ff /src
parentf2885d3fb7045d14ae58824e9cb8dea65e4052c4 (diff)
downloadvim-git-024dbd229fa7991b7bf7ef4d0888b43ab03783f7.tar.gz
patch 8.1.2241: match highlight does not combine with 'wincolor'v8.1.2241
Problem: Match highlight does not combine with 'wincolor'. Solution: Apply 'wincolor' last on top of any other attribute. (closes #5159)
Diffstat (limited to 'src')
-rw-r--r--src/drawline.c18
-rw-r--r--src/testdir/dumps/Test_popupwin_matches.dump4
-rw-r--r--src/testdir/dumps/Test_popupwin_menu_01.dump2
-rw-r--r--src/testdir/dumps/Test_popupwin_menu_02.dump2
-rw-r--r--src/testdir/dumps/Test_popupwin_menu_04.dump2
-rw-r--r--src/testdir/test_popupwin.vim5
-rw-r--r--src/version.c2
7 files changed, 19 insertions, 16 deletions
diff --git a/src/drawline.c b/src/drawline.c
index 7caba051b..dcfe92cc6 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -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;
}
-
diff --git a/src/testdir/dumps/Test_popupwin_matches.dump b/src/testdir/dumps/Test_popupwin_matches.dump
index ba3e72025..6d9faf347 100644
--- a/src/testdir/dumps/Test_popupwin_matches.dump
+++ b/src/testdir/dumps/Test_popupwin_matches.dump
@@ -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
diff --git a/src/testdir/dumps/Test_popupwin_menu_01.dump b/src/testdir/dumps/Test_popupwin_menu_01.dump
index 3f09f3e08..b41b39829 100644
--- a/src/testdir/dumps/Test_popupwin_menu_01.dump
+++ b/src/testdir/dumps/Test_popupwin_menu_01.dump
@@ -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
diff --git a/src/testdir/dumps/Test_popupwin_menu_02.dump b/src/testdir/dumps/Test_popupwin_menu_02.dump
index 464e27643..b7a40e81d 100644
--- a/src/testdir/dumps/Test_popupwin_menu_02.dump
+++ b/src/testdir/dumps/Test_popupwin_menu_02.dump
@@ -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
diff --git a/src/testdir/dumps/Test_popupwin_menu_04.dump b/src/testdir/dumps/Test_popupwin_menu_04.dump
index 30706a76c..2ee61fc24 100644
--- a/src/testdir/dumps/Test_popupwin_menu_04.dump
+++ b/src/testdir/dumps/Test_popupwin_menu_04.dump
@@ -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
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index 2dcd14d37..2c4da0b79 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -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})
diff --git a/src/version.c b/src/version.c
index bd0390ace..c5976759b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 2241,
+/**/
2240,
/**/
2239,