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/ui.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/nvim/ui.c') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index ef0386e395..d13c7e5feb 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -114,6 +114,16 @@ void ui_write(uint8_t *s, int len) free(tofree); } +bool ui_rgb_attached(void) +{ + for (size_t i = 0; i < ui_count; i++) { + if (uis[i]->rgb) { + return true; + } + } + return false; +} + /* * If the machine has job control, use it to suspend the program, * otherwise fake it by starting a new shell. -- cgit