Skip to content

Commit 76bb719

Browse files
committed
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.
1 parent 2f05849 commit 76bb719

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

src/terminal.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,6 +1833,23 @@ cell2attr(VTermScreenCellAttrs cellattrs, VTermColor cellfg, VTermColor cellbg)
18331833
int fg = color2index(&cellfg, TRUE, &bold);
18341834
int bg = color2index(&cellbg, FALSE, &bold);
18351835

1836+
/* Use the "Terminal" highlighting for the default colors. */
1837+
if (fg == 0 || bg == 0)
1838+
{
1839+
int id = syn_name2id((char_u *)"Terminal");
1840+
1841+
if (id != 0 && t_colors >= 16)
1842+
{
1843+
int cterm_fg, cterm_bg;
1844+
1845+
syn_id2cterm_bg(id, &cterm_fg, &cterm_bg);
1846+
if (cterm_fg >= 0)
1847+
fg = cterm_fg + 1;
1848+
if (cterm_bg >= 0)
1849+
bg = cterm_bg + 1;
1850+
}
1851+
}
1852+
18361853
/* with 8 colors set the bold attribute to get a bright foreground */
18371854
if (bold == TRUE)
18381855
attr |= HL_BOLD;

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1360,
774776
/**/
775777
1359,
776778
/**/

0 commit comments

Comments
 (0)