diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-11-30 22:07:07 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-11-30 22:07:07 +0100 |
commit | 76bb7196f5102c9929959d710e8ed97a19affa4d (patch) | |
tree | 8e6209d69740a3690cbcee8dde6745f416b2d993 /src/terminal.c | |
parent | 2f0584910c0ea93966dfa7b3b0272dfb16ea6f91 (diff) | |
download | vim-git-76bb7196f5102c9929959d710e8ed97a19affa4d.tar.gz |
patch 8.0.1360: the Terminal highlighting doesn't work in a terminalv8.0.1360
Problem: The Terminal highlighting doesn't work in a terminal. (Ozaki
Kiichi)
Solution: Use the Terminal highlighting when the cterm index is zero.
Diffstat (limited to 'src/terminal.c')
-rw-r--r-- | src/terminal.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/terminal.c b/src/terminal.c index 2c3197473..a2858a2b0 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -1833,6 +1833,23 @@ cell2attr(VTermScreenCellAttrs cellattrs, VTermColor cellfg, VTermColor cellbg) int fg = color2index(&cellfg, TRUE, &bold); int bg = color2index(&cellbg, FALSE, &bold); + /* Use the "Terminal" highlighting for the default colors. */ + if (fg == 0 || bg == 0) + { + int id = syn_name2id((char_u *)"Terminal"); + + if (id != 0 && t_colors >= 16) + { + int cterm_fg, cterm_bg; + + syn_id2cterm_bg(id, &cterm_fg, &cterm_bg); + if (cterm_fg >= 0) + fg = cterm_fg + 1; + if (cterm_bg >= 0) + bg = cterm_bg + 1; + } + } + /* with 8 colors set the bold attribute to get a bright foreground */ if (bold == TRUE) attr |= HL_BOLD; |