aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.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/eval.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/eval.c')
-rw-r--r--src/nvim/eval.c5
1 files changed, 4 insertions, 1 deletions
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';