diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-01-13 08:38:38 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-01-13 21:21:20 -0300 |
commit | 3e9c55b51b07fbde649f9e49d266cd0fc1121ad9 (patch) | |
tree | 31bce0a1941a301925f366eded6ab574c014541a /src/nvim/ui.c | |
parent | 8f3e61a043f6b1a3b22d56029ff878e54299ec7c (diff) | |
download | rneovim-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/ui.c')
-rw-r--r-- | src/nvim/ui.c | 10 |
1 files changed, 10 insertions, 0 deletions
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. |