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.
This commit is contained in:
Marco Hinz
2015-07-14 00:36:21 +02:00
parent 7732bec9b8
commit 84ce97714b

View File

@@ -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';
}