From acc5d08b371c9521d63aa4a37cce9ffab451d21d Mon Sep 17 00:00:00 2001 From: Shougo Matsushita Date: Mon, 2 May 2016 07:34:06 +0900 Subject: 'termguicolors' #4690 TODO: Only works at startup (i.e., in the user's init.vim/vimrc/--cmd), but it should probably work at any time. --- patch 7.4.1799 Problem: 'guicolors' is a confusing option name. Solution: Use 'termguicolors' instead. (Hirohito Higashi) https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 patch 7.4.1806 Problem: 'termguicolors' option missing from the options window. Solution: Add the entry. https://github.com/vim/vim/commit/8e3d1b6326c103cc92f8d07b1161ee5172acf201 patch 7.4.1808 Problem: Using wrong feature name to check for 'termguicolors'. Solution: Use the right feature name. (Ken Takata) https://github.com/vim/vim/commit/8a24b794b89916c8074892e7b25121a21f1fa9c9 patch 7.4.1809 Problem: Using wrong short option name for 'termguicolors'. Solution: Use the option name. https://github.com/vim/vim/commit/868cfc19bb079a16ca58884b551486566f35419b --- src/nvim/eval.c | 1 + src/nvim/option_defs.h | 1 + src/nvim/options.lua | 8 ++++++++ src/nvim/tui/tui.c | 2 +- src/nvim/version.c | 4 ++++ 5 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 6e9f89bbb5..8c8881b398 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -10684,6 +10684,7 @@ static void f_has(typval_T *argvars, typval_T *rettv) "tablineat", "tag_binary", "tag_old_static", + "termguicolors", "termresponse", "textobjects", "title", diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index 87a9a7398c..904e97f8ca 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -619,6 +619,7 @@ EXTERN long p_titlelen; ///< 'titlelen' EXTERN char_u *p_titleold; ///< 'titleold' EXTERN char_u *p_titlestring; ///< 'titlestring' EXTERN char_u *p_tsr; ///< 'thesaurus' +EXTERN bool p_tgc; ///< 'termguicolors' EXTERN int p_ttimeout; ///< 'ttimeout' EXTERN long p_ttm; ///< 'ttimeoutlen' EXTERN char_u *p_udir; ///< 'undodir' diff --git a/src/nvim/options.lua b/src/nvim/options.lua index a743e8c605..218e34f595 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -2382,6 +2382,14 @@ return { redraw={'everything'}, defaults={if_true={vi=""}} }, + { + full_name='termguicolors', abbreviation='tgc', + type='bool', scope={'global'}, + vi_def=false, + redraw={'everything'}, + varname='p_tgc', + defaults={if_true={vi=false}} + }, { full_name='terse', type='bool', scope={'global'}, diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c index e1c0407b27..202c5666a1 100644 --- a/src/nvim/tui/tui.c +++ b/src/nvim/tui/tui.c @@ -81,7 +81,7 @@ UI *tui_start(void) { UI *ui = xcalloc(1, sizeof(UI)); ui->stop = tui_stop; - ui->rgb = os_getenv("NVIM_TUI_ENABLE_TRUE_COLOR") != NULL; + ui->rgb = p_tgc; ui->resize = tui_resize; ui->clear = tui_clear; ui->eol_clear = tui_eol_clear; diff --git a/src/nvim/version.c b/src/nvim/version.c index 81137ff1c6..00f8c28b5e 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -69,6 +69,10 @@ static char *features[] = { // clang-format off static int included_patches[] = { + 1809, + 1808, + 1806, + 1799, 1757, 1755, 1753, -- cgit