Skip to content

Commit c1b292f

Browse files
committed
Solves #3, italic not supported on some terminals
1 parent 28ee9e8 commit c1b292f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

colors/one.vim

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ syntax reset
1212
"endif
1313
let g:colors_name = 'one'
1414

15+
if !exists("g:one_allow_italics")
16+
let g:one_allow_italics = 0
17+
endif
18+
1519
if has('gui_running') || &t_Co == 88 || &t_Co == 256
1620
" functions
1721
" returns an approximate grey index for the given grey level
@@ -212,14 +216,19 @@ if has('gui_running') || &t_Co == 88 || &t_Co == 256
212216

213217
" sets the highlighting for the given group
214218
fun <SID>X(group, fg, bg, attr)
219+
let l:attr = a:attr
220+
if g:one_allow_italics == 0 && l:attr ==? 'italic'
221+
let l:attr= 'none'
222+
endif
223+
215224
if a:fg !=? ''
216225
exec 'hi ' . a:group . ' guifg=#' . a:fg . ' ctermfg=' . <SID>rgb(a:fg)
217226
endif
218227
if a:bg !=? ''
219228
exec 'hi ' . a:group . ' guibg=#' . a:bg . ' ctermbg=' . <SID>rgb(a:bg)
220229
endif
221230
if a:attr !=? ''
222-
exec 'hi ' . a:group . ' gui=' . a:attr . ' cterm=' . a:attr
231+
exec 'hi ' . a:group . ' gui=' . l:attr . ' cterm=' . l:attr
223232
endif
224233
endfun
225234

0 commit comments

Comments
 (0)