Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions autoload/base16.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function! base16#highlight(bang, group, ...)
echohl None
return
endif
let l:termguicolors = (has('termguicolors') && &termguicolors)
let l:fg = 0
let l:bg = 0
let l:sp = 0
Expand All @@ -15,14 +16,14 @@ function! base16#highlight(bang, group, ...)
let l:fg = 1
let [l:gui, l:cterm] = s:Color(l:arg[3:])
execute 'highlight' a:group 'guifg='.l:gui
if !has('termguicolors') || !&termguicolors
if !termguicolors
execute 'highlight' a:group 'ctermfg='.l:cterm
endif
elseif l:arg =~? '^bg='
let l:bg = 1
let [l:gui, l:cterm] = s:Color(l:arg[3:])
execute 'highlight' a:group 'guibg='.l:gui
if !has('termguicolors') || !&termguicolors
if !termguicolors
execute 'highlight' a:group 'ctermbg='.l:cterm
endif
elseif l:arg =~? '^sp='
Expand All @@ -44,8 +45,14 @@ function! base16#highlight(bang, group, ...)
endif
if len(l:attrs) > 0
execute 'highlight' a:group 'gui='.join(l:attrs, ',')
if !termguicolors
execute 'highlight' a:group 'cterm='.join(l:attrs, ',')
endif
elseif a:bang
execute 'highlight' a:group 'gui=NONE'
if !termguicolors
execute 'highlight' a:group 'cterm=NONE'
endif
endif
endfunction

Expand Down