Skip to content

Commit

Permalink
Solves #3, italic not supported on some terminals
Browse files Browse the repository at this point in the history
  • Loading branch information
rakr committed Jul 1, 2016
1 parent 28ee9e8 commit c1b292f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion colors/one.vim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ syntax reset
"endif
let g:colors_name = 'one'

if !exists("g:one_allow_italics")
let g:one_allow_italics = 0
endif

if has('gui_running') || &t_Co == 88 || &t_Co == 256
" functions
" returns an approximate grey index for the given grey level
Expand Down Expand Up @@ -212,14 +216,19 @@ if has('gui_running') || &t_Co == 88 || &t_Co == 256

" sets the highlighting for the given group
fun <SID>X(group, fg, bg, attr)
let l:attr = a:attr
if g:one_allow_italics == 0 && l:attr ==? 'italic'
let l:attr= 'none'
endif

if a:fg !=? ''
exec 'hi ' . a:group . ' guifg=#' . a:fg . ' ctermfg=' . <SID>rgb(a:fg)
endif
if a:bg !=? ''
exec 'hi ' . a:group . ' guibg=#' . a:bg . ' ctermbg=' . <SID>rgb(a:bg)
endif
if a:attr !=? ''
exec 'hi ' . a:group . ' gui=' . a:attr . ' cterm=' . a:attr
exec 'hi ' . a:group . ' gui=' . l:attr . ' cterm=' . l:attr
endif
endfun

Expand Down

0 comments on commit c1b292f

Please sign in to comment.