Skip to content

Commit

Permalink
Make gui mode respect g:onedark_terminal_italics setting.
Browse files Browse the repository at this point in the history
Fixes #44.
  • Loading branch information
joshdick committed Jul 20, 2016
1 parent e855932 commit f67e4c0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions colors/onedark.vim
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,24 @@ if !exists("g:onedark_terminal_italics")
let g:onedark_terminal_italics = 0
endif

" This function was borrowed from FlatColor: https://github.com/MaxSt/FlatColor/
" It was based on one found in hemisu: https://github.com/noahfrederick/vim-hemisu/
" This function is based on one from FlatColor: https://github.com/MaxSt/FlatColor/
" Which in turn was based on one found in hemisu: https://github.com/noahfrederick/vim-hemisu/
function! s:h(group, style)
if g:onedark_terminal_italics == 0 && has_key(a:style, "cterm") && a:style["cterm"] == "italic"
unlet a:style.cterm
if g:onedark_terminal_italics == 0
if has_key(a:style, "cterm") && a:style["cterm"] == "italic"
unlet a:style.cterm
endif
if has_key(a:style, "gui") && a:style["gui"] == "italic"
unlet a:style.gui
endif
endif
if g:onedark_termcolors == 16
let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm16 : "NONE")
let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm16 : "NONE")
else
let l:ctermfg = (has_key(a:style, "fg") ? a:style.fg.cterm : "NONE")
let l:ctermbg = (has_key(a:style, "bg") ? a:style.bg.cterm : "NONE")
end
endif
execute "highlight" a:group
\ "guifg=" (has_key(a:style, "fg") ? a:style.fg.gui : "NONE")
\ "guibg=" (has_key(a:style, "bg") ? a:style.bg.gui : "NONE")
Expand Down

0 comments on commit f67e4c0

Please sign in to comment.