From 3e9c55b51b07fbde649f9e49d266cd0fc1121ad9 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Tue, 13 Jan 2015 08:38:38 -0300 Subject: 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. --- src/nvim/eval.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d60ce2de73..417efd52a1 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -76,6 +76,7 @@ #include "nvim/tag.h" #include "nvim/tempfile.h" #include "nvim/term.h" +#include "nvim/ui.h" #include "nvim/mouse.h" #include "nvim/undo.h" #include "nvim/version.h" @@ -10023,6 +10024,8 @@ static void f_has(typval_T *argvars, typval_T *rettv) #endif } else if (STRICMP(name, "syntax_items") == 0) { n = syntax_present(curwin); + } else if (STRICMP(name, "gui_running") == 0) { + n = ui_rgb_attached(); } } @@ -14440,7 +14443,7 @@ static void f_synIDattr(typval_T *argvars, typval_T *rettv) if (modec != 't' && modec != 'c' && modec != 'g') modec = 0; /* replace invalid with current */ } else { - if (t_colors > 1) + if (abstract_ui || t_colors > 1) modec = 'c'; else modec = 't'; -- cgit