From 6ee75bdbdedd92ad36ceef950c60ea55beb8511d Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Fri, 11 Aug 2017 12:05:39 +0200 Subject: [PATCH] Fix failing tests --- plugin/airline.vim | 1 + t/builder.vim | 2 ++ t/themes.vim | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/plugin/airline.vim b/plugin/airline.vim index 51927de..8f0b531 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -81,6 +81,7 @@ function! s:airline_toggle() if exists("s:stl") let &stl = s:stl endif + call airline#highlighter#reset_hlcache() silent doautocmd User AirlineToggledOff else diff --git a/t/builder.vim b/t/builder.vim index d3b0092..0b07df7 100644 --- a/t/builder.vim +++ b/t/builder.vim @@ -19,6 +19,7 @@ describe 'active builder' end it 'should reuse highlight group if background colors match' + call airline#highlighter#reset_hlcache() highlight Foo1 ctermfg=1 ctermbg=2 highlight Foo2 ctermfg=1 ctermbg=2 call s:builder.add_section('Foo1', 'hello') @@ -28,6 +29,7 @@ describe 'active builder' end it 'should switch highlight groups if foreground colors differ' + call airline#highlighter#reset_hlcache() highlight Foo1 ctermfg=1 ctermbg=2 highlight Foo2 ctermfg=2 ctermbg=2 call s:builder.add_section('Foo1', 'hello') diff --git a/t/themes.vim b/t/themes.vim index 5a13993..b8a8fb2 100644 --- a/t/themes.vim +++ b/t/themes.vim @@ -5,6 +5,7 @@ describe 'themes' end it 'should extract correct colors' + call airline#highlighter#reset_hlcache() highlight Foo ctermfg=1 ctermbg=2 let colors = airline#themes#get_highlight('Foo') Expect colors[2] == '1' @@ -12,6 +13,7 @@ describe 'themes' end it 'should extract from normal if colors unavailable' + call airline#highlighter#reset_hlcache() highlight Normal ctermfg=100 ctermbg=200 highlight Foo ctermbg=2 let colors = airline#themes#get_highlight('Foo') @@ -20,6 +22,7 @@ describe 'themes' end it 'should flip target group if it is reversed' + call airline#highlighter#reset_hlcache() highlight Foo ctermbg=222 ctermfg=103 term=reverse let colors = airline#themes#get_highlight('Foo') Expect colors[2] == '222' @@ -27,6 +30,8 @@ describe 'themes' end it 'should pass args through correctly' + call airline#highlighter#reset_hlcache() + hi clear Normal let hl = airline#themes#get_highlight('Foo', 'bold', 'italic') Expect hl == ['', '', 'NONE', 'NONE', 'bold,italic']