Mercurial > vim
comparison src/terminal.c @ 12969:a9f6a874b64f v8.0.1360
patch 8.0.1360: the Terminal highlighting doesn't work in a terminal
commit https://github.com/vim/vim/commit/76bb7196f5102c9929959d710e8ed97a19affa4d
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 30 22:07:07 2017 +0100
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 30 Nov 2017 22:15:05 +0100 |
parents | c5bccd50100e |
children | 418941f0df08 |
comparison
equal
deleted
inserted
replaced
12968:45987b1b77dc | 12969:a9f6a874b64f |
---|---|
1831 { | 1831 { |
1832 int bold = MAYBE; | 1832 int bold = MAYBE; |
1833 int fg = color2index(&cellfg, TRUE, &bold); | 1833 int fg = color2index(&cellfg, TRUE, &bold); |
1834 int bg = color2index(&cellbg, FALSE, &bold); | 1834 int bg = color2index(&cellbg, FALSE, &bold); |
1835 | 1835 |
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 | |
1836 /* with 8 colors set the bold attribute to get a bright foreground */ | 1853 /* with 8 colors set the bold attribute to get a bright foreground */ |
1837 if (bold == TRUE) | 1854 if (bold == TRUE) |
1838 attr |= HL_BOLD; | 1855 attr |= HL_BOLD; |
1839 return get_cterm_attr_idx(attr, fg, bg); | 1856 return get_cterm_attr_idx(attr, fg, bg); |
1840 } | 1857 } |