aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-02-11 21:22:02 +0100
committerGitHub <noreply@github.com>2019-02-11 21:22:02 +0100
commit5e44a5945a0f5909aff02a386216a965aee327f7 (patch)
tree06f9879a473e126fdfce2b6b931c8dcbc8603c16 /src
parentb3ce0019a78ee85d44513344ce52d9da43077231 (diff)
parentaf51ae944e8cf41b04a33a0b5ad5300b1fa99521 (diff)
downloadrneovim-5e44a5945a0f5909aff02a386216a965aee327f7.tar.gz
rneovim-5e44a5945a0f5909aff02a386216a965aee327f7.tar.bz2
rneovim-5e44a5945a0f5909aff02a386216a965aee327f7.zip
Merge pull request #9603 from bfredl/reversepum
highlight: handle blending with gui=reverse and guisp attribute
Diffstat (limited to 'src')
-rw-r--r--src/nvim/highlight.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c
index cbb28d9a09..ec07f09481 100644
--- a/src/nvim/highlight.c
+++ b/src/nvim/highlight.c
@@ -314,6 +314,14 @@ static HlAttrs get_colors_force(int attr)
}
HL_SET_DEFAULT_COLORS(attrs.rgb_fg_color, attrs.rgb_bg_color,
attrs.rgb_sp_color);
+
+ if (attrs.rgb_ae_attr & HL_INVERSE) {
+ int temp = attrs.rgb_bg_color;
+ attrs.rgb_bg_color = attrs.rgb_fg_color;
+ attrs.rgb_fg_color = temp;
+ attrs.rgb_ae_attr &= ~HL_INVERSE;
+ }
+
return attrs;
}
@@ -338,6 +346,13 @@ int hl_blend_attrs(int back_attr, int front_attr, bool through)
cattrs = battrs;
cattrs.rgb_fg_color = rgb_blend((int)p_pb, battrs.rgb_fg_color,
fattrs.rgb_bg_color);
+ if (cattrs.rgb_ae_attr & (HL_UNDERLINE|HL_UNDERCURL)) {
+ cattrs.rgb_sp_color = rgb_blend((int)p_pb, battrs.rgb_sp_color,
+ fattrs.rgb_bg_color);
+ } else {
+ cattrs.rgb_sp_color = -1;
+ }
+
cattrs.cterm_bg_color = fattrs.cterm_bg_color;
cattrs.cterm_fg_color = fattrs.cterm_bg_color;
} else {
@@ -347,6 +362,12 @@ int hl_blend_attrs(int back_attr, int front_attr, bool through)
}
cattrs.rgb_fg_color = rgb_blend((int)p_pb/2, battrs.rgb_fg_color,
fattrs.rgb_fg_color);
+ if (cattrs.rgb_ae_attr & (HL_UNDERLINE|HL_UNDERCURL)) {
+ cattrs.rgb_sp_color = rgb_blend((int)p_pb/2, battrs.rgb_bg_color,
+ fattrs.rgb_sp_color);
+ } else {
+ cattrs.rgb_sp_color = -1;
+ }
}
cattrs.rgb_bg_color = rgb_blend((int)p_pb, battrs.rgb_bg_color,
fattrs.rgb_bg_color);