diff options
author | Daniel Hahler <git@thequod.de> | 2019-06-17 22:35:07 +0200 |
---|---|---|
committer | Daniel Hahler <git@thequod.de> | 2019-09-26 00:50:54 +0200 |
commit | cb252071718a58c2d9747177ebeb81ff1210ddd1 (patch) | |
tree | 3c5a5ae77471901e9904c96f9bd11638dc639031 /src/nvim/highlight.c | |
parent | 2621f4455d6409427a57ea5d4a123e860e27eacd (diff) | |
download | rneovim-cb252071718a58c2d9747177ebeb81ff1210ddd1.tar.gz rneovim-cb252071718a58c2d9747177ebeb81ff1210ddd1.tar.bz2 rneovim-cb252071718a58c2d9747177ebeb81ff1210ddd1.zip |
vim-patch:8.0.0914: highlight attributes are always combined (#10256)
Problem: Highlight attributes are always combined.
Solution: Add the 'nocombine' value to replace attributes instead of
combining them. (scauligi, closes vim/vim#1963)
https://github.com/vim/vim/commit/0cd2a94a4030f6bd12eaec44db92db108e33c913
Closes https://github.com/neovim/neovim/pull/10256.
Diffstat (limited to 'src/nvim/highlight.c')
-rw-r--r-- | src/nvim/highlight.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/nvim/highlight.c b/src/nvim/highlight.c index 093cc4923b..83ee89b2a1 100644 --- a/src/nvim/highlight.c +++ b/src/nvim/highlight.c @@ -308,8 +308,16 @@ int hl_combine_attr(int char_attr, int prim_attr) // start with low-priority attribute, and override colors if present below. HlAttrs new_en = char_aep; - new_en.cterm_ae_attr |= spell_aep.cterm_ae_attr; - new_en.rgb_ae_attr |= spell_aep.rgb_ae_attr; + if (spell_aep.cterm_ae_attr & HL_NOCOMBINE) { + new_en.cterm_ae_attr = spell_aep.cterm_ae_attr; + } else { + new_en.cterm_ae_attr |= spell_aep.cterm_ae_attr; + } + if (spell_aep.rgb_ae_attr & HL_NOCOMBINE) { + new_en.rgb_ae_attr = spell_aep.rgb_ae_attr; + } else { + new_en.rgb_ae_attr |= spell_aep.rgb_ae_attr; + } if (spell_aep.cterm_fg_color > 0) { new_en.cterm_fg_color = spell_aep.cterm_fg_color; |