Skip to content
Snippets Groups Projects
Unverified Commit cbb51348 authored by Junegunn Choi's avatar Junegunn Choi
Browse files

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

parent ff248d56
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment