diff --git a/autoload/lightline.vim b/autoload/lightline.vim index b6bcebb..e85e589 100644 --- a/autoload/lightline.vim +++ b/autoload/lightline.vim @@ -2,7 +2,7 @@ " Filename: autoload/lightline.vim " Author: itchyny " License: MIT License -" Last Change: 2020/06/19 07:27:34. +" Last Change: 2020/06/19 11:08:46. " ============================================================================= let s:save_cpo = &cpo @@ -198,13 +198,7 @@ function! lightline#colorscheme() abort let s:lightline.palette = g:lightline#colorscheme#{s:lightline.colorscheme}#palette finally if has('win32') && !has('gui_running') && &t_Co < 256 - for u in values(s:lightline.palette) - for v in values(u) - for _ in v - let [_[2], _[3]] = [lightline#colortable#gui2cui(_[0], _[2]), lightline#colortable#gui2cui(_[1], _[3])] - endfor - endfor - endfor + call lightline#colortable#gui2cui_palette(s:lightline.palette) endif let s:highlight = {} call lightline#highlight('normal') diff --git a/autoload/lightline/colortable.vim b/autoload/lightline/colortable.vim index 82617b2..6cdddd8 100644 --- a/autoload/lightline/colortable.vim +++ b/autoload/lightline/colortable.vim @@ -2,7 +2,7 @@ " Filename: autoload/lightline/colortable.vim " Author: itchyny " License: MIT License -" Last Change: 2015/03/29 06:21:39. +" Last Change: 2020/06/19 11:07:13. " ============================================================================= let s:save_cpo = &cpo @@ -38,5 +38,15 @@ function! lightline#colortable#gui2cui(rgb, fallback) abort return rgb[0] + rgb[1] + rgb[2] endfunction +function! lightline#colortable#gui2cui_palette(palette) abort + for u in values(a:palette) + for v in values(u) + for w in v + let [w[2], w[3]] = [lightline#colortable#gui2cui(w[0], w[2]), lightline#colortable#gui2cui(w[1], w[3])] + endfor + endfor + endfor +endfunction + let &cpo = s:save_cpo unlet s:save_cpo