[vim] Use 24-bit colors if termguicolors is set

pull/828/head
Junegunn Choi 7 years ago
parent ff248d566d
commit cbb5134874
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627

@ -167,9 +167,12 @@ function! s:common_sink(action, lines) abort
endfunction
function! s:get_color(attr, ...)
let gui = has('termguicolors') && &termguicolors
let fam = gui ? 'gui' : 'cterm'
let pat = gui ? '^#[a-f0-9]\+' : '^[0-9]\+$'
for group in a:000
let code = synIDattr(synIDtrans(hlID(group)), a:attr, 'cterm')
if code =~ '^[0-9]\+$'
let code = synIDattr(synIDtrans(hlID(group)), a:attr, fam)
if code =~? pat
return code
endif
endfor

Loading…
Cancel
Save