Permalink
Browse files

patch 8.0.1360: the Terminal highlighting doesn't work in a terminal

Problem:    The Terminal highlighting doesn't work in a terminal. (Ozaki
            Kiichi)
Solution:   Use the Terminal highlighting when the cterm index is zero.
  • Loading branch information...
brammool committed Nov 30, 2017
1 parent 2f05849 commit 76bb7196f5102c9929959d710e8ed97a19affa4d
Showing with 19 additions and 0 deletions.
  1. +17 −0 src/terminal.c
  2. +2 −0 src/version.c
View
@@ -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;
View
@@ -771,6 +771,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1360,
/**/
1359,
/**/

0 comments on commit 76bb719

Please sign in to comment.