diff --git a/colors/onedark.vim b/colors/onedark.vim index 15c2565..f92739e 100644 --- a/colors/onedark.vim +++ b/colors/onedark.vim @@ -70,11 +70,16 @@ 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") @@ -82,7 +87,7 @@ function! s:h(group, style) 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")