aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/syntax.c
diff options
context:
space:
mode:
authorThiago de Arruda <tpadilha84@gmail.com>2015-01-13 08:38:38 -0300
committerThiago de Arruda <tpadilha84@gmail.com>2015-01-13 21:21:20 -0300
commit3e9c55b51b07fbde649f9e49d266cd0fc1121ad9 (patch)
tree31bce0a1941a301925f366eded6ab574c014541a /src/nvim/syntax.c
parent8f3e61a043f6b1a3b22d56029ff878e54299ec7c (diff)
downloadrneovim-3e9c55b51b07fbde649f9e49d266cd0fc1121ad9.tar.gz
rneovim-3e9c55b51b07fbde649f9e49d266cd0fc1121ad9.tar.bz2
rneovim-3e9c55b51b07fbde649f9e49d266cd0fc1121ad9.zip
main: Fix color schemes for abstract_ui
- Set 't_Co' to 256 at startup. The value can be changed by the user for compatibility with terminals that are less capable. - `has('gui_running')` will return 1 if at least one rgb UI is attached. Even though these changes are hacky, they are necessary to make the transition to the new UI architecture smoother.
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r--src/nvim/syntax.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c
index efb449f037..8ff0c71f69 100644
--- a/src/nvim/syntax.c
+++ b/src/nvim/syntax.c
@@ -6450,7 +6450,7 @@ do_highlight (
p = T_CAF;
else
p = T_CSF;
- if (*p != NUL && *(p + STRLEN(p) - 1) == 'm')
+ if (abstract_ui || (*p != NUL && *(p + STRLEN(p) - 1) == 'm'))
switch (t_colors) {
case 16:
color = color_numbers_8[i];
@@ -6865,7 +6865,7 @@ int hl_combine_attr(int char_attr, int prim_attr)
if (char_attr <= HL_ALL && prim_attr <= HL_ALL)
return char_attr | prim_attr;
- if (t_colors > 1) {
+ if (abstract_ui || t_colors > 1) {
if (char_attr > HL_ALL)
char_aep = syn_cterm_attr2entry(char_attr);
if (char_aep != NULL)
@@ -6929,7 +6929,7 @@ int syn_attr2attr(int attr)
{
attrentry_T *aep;
- if (t_colors > 1)
+ if (abstract_ui || t_colors > 1)
aep = syn_cterm_attr2entry(attr);
else
aep = syn_term_attr2entry(attr);
@@ -7357,7 +7357,7 @@ int syn_id2attr(int hl_id)
hl_id = syn_get_final_id(hl_id);
sgp = &HL_TABLE()[hl_id - 1]; /* index is ID minus one */
- if (t_colors > 1)
+ if (abstract_ui || t_colors > 1)
attr = sgp->sg_cterm_attr;
else
attr = sgp->sg_term_attr;