]> granicus.if.org Git - vim/commitdiff
patch 8.0.1360: the Terminal highlighting doesn't work in a terminal v8.0.1360
authorBram Moolenaar <Bram@vim.org>
Thu, 30 Nov 2017 21:07:07 +0000 (22:07 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 30 Nov 2017 21:07:07 +0000 (22:07 +0100)
Problem:    The Terminal highlighting doesn't work in a terminal. (Ozaki
            Kiichi)
Solution:   Use the Terminal highlighting when the cterm index is zero.

src/terminal.c
src/version.c

index 2c31974739b86bbc9b4662ee4fb495dc7110e4ed..a2858a2b0024f07b73a42bb31d52ca1681959836 100644 (file)
@@ -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;
index 075760fd3573fd747bea49faff45a106fb88d9e0..ece615ca585cc91802a7e2d66677a2ff6a55120e 100644 (file)
@@ -771,6 +771,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1360,
 /**/
     1359,
 /**/