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/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/nvim/main.c') diff --git a/src/nvim/main.c b/src/nvim/main.c index f063cc1238..7ca26a6eba 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -261,10 +261,7 @@ int main(int argc, char **argv) if (params.want_full_screen && !silent_mode) { if (embedded_mode) { - // In embedded mode don't do terminal-related initializations, assume an - // initial screen size of 80x20 - full_screen = true; - screen_resize(80, 20, false); + // embedded mode implies abstract_ui termcapinit((uint8_t *)"abstract_ui"); } else { // set terminal name and get terminal capabilities (will set full_screen) @@ -278,7 +275,9 @@ int main(int argc, char **argv) event_init(); if (abstract_ui) { + full_screen = true; t_colors = 256; + T_CCO = (uint8_t *)"256"; } else { // Print a warning if stdout is not a terminal TODO(tarruda): Remove this // check once the new terminal UI is implemented -- cgit