fix highlight links on resetting highlights (ref: Vim 8.2.1703 213da551) (close #512)

This commit is contained in:
itchyny
2020-09-25 11:00:11 +09:00
parent f5f870e0ac
commit 2afc3ab4dd
2 changed files with 16 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
" Filename: autoload/lightline.vim
" Author: itchyny
" License: MIT License
" Last Change: 2020/09/05 20:57:51.
" Last Change: 2020/09/25 10:56:16.
" =============================================================================
let s:save_cpo = &cpo
@@ -290,6 +290,7 @@ function! lightline#highlight(...) abort
endfor
exec printf('hi LightlineMiddle_%s guifg=%s guibg=%s ctermfg=%s ctermbg=%s %s', mode, ms[0], ms[1], ms[2], ms[3], s:term(ms))
endfor
if !a:0 | let s:mode = '' | endif
endfunction
function! s:subseparator(components, subseparator, expanded) abort

View File

@@ -141,3 +141,17 @@ function! s:suite.component_type()
endfor
endfor
endfunction
function! s:suite.hi_clear()
call lightline#link()
colorscheme default
call lightline#link()
call s:assert.match(s:hi('LightlineLeft_active_0'), 'LightlineLeft_normal_0')
call s:assert.match(s:hi('LightlineLeft_active_1'), 'LightlineLeft_normal_1')
call s:assert.match(s:hi('LightlineLeft_active_2'), 'E411: highlight group not found\|cleared')
call s:assert.match(s:hi('LightlineRight_active_0'), 'LightlineRight_normal_0')
call s:assert.match(s:hi('LightlineRight_active_1'), 'LightlineRight_normal_1')
call s:assert.match(s:hi('LightlineRight_active_2'), 'LightlineRight_normal_2')
call s:assert.match(s:hi('LightlineRight_active_3'), 'E411: highlight group not found\|cleared')
call s:assert.match(s:hi('LightlineMiddle_active'), 'LightlineMiddle_normal')
endfunction