From 84ce97714b4f614da0851b74e9774d5b50e881a2 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Tue, 14 Jul 2015 00:36:21 +0200 Subject: synIDattr(): true color awareness In Vim, which doesn't true colors, synIDattr('Foo', 'fg') returns either ctermfg or guifg depending on whether vim or gvim is running. True colors naturally use GUI colors, so synIDattr() has to be adapted to return guifg, if a TUI with enabled true colors is used. --- src/nvim/eval.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 21f21a4c80..9957643c8d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -14699,6 +14699,8 @@ static void f_synIDattr(typval_T *argvars, typval_T *rettv) modec = TOLOWER_ASC(mode[0]); if (modec != 'c' && modec != 'g') modec = 0; /* replace invalid with current */ + } else if (ui_rgb_attached()) { + modec = 'g'; } else { modec = 'c'; } -- cgit