undo use of inverse; caused problems with empty sections.
This commit is contained in:
parent
f773325fa4
commit
dd5dbdd242
|
@ -10,8 +10,10 @@ endfunction
|
||||||
|
|
||||||
function! s:prototype.add_section(group, contents)
|
function! s:prototype.add_section(group, contents)
|
||||||
if self._curgroup != ''
|
if self._curgroup != ''
|
||||||
call self._highlighter.add_separator(self._group(self._curgroup), self._group(a:group), self._side)
|
call self._highlighter.add_separator(self._group(self._curgroup), self._group(a:group))
|
||||||
let self._line .= '%#'.self._group(self._curgroup).'_to_'.self._group(a:group).'#'
|
let self._line .= self._side
|
||||||
|
\ ? '%#'.self._group(a:group).'_to_'.self._group(self._curgroup).'#'
|
||||||
|
\ : '%#'.self._group(self._curgroup).'_to_'.self._group(a:group).'#'
|
||||||
let self._line .= self._side
|
let self._line .= self._side
|
||||||
\ ? self._active ? g:airline_left_sep : g:airline_left_alt_sep
|
\ ? self._active ? g:airline_left_sep : g:airline_left_alt_sep
|
||||||
\ : self._active ? g:airline_right_sep : g:airline_right_alt_sep
|
\ : self._active ? g:airline_right_sep : g:airline_right_alt_sep
|
||||||
|
|
|
@ -19,11 +19,11 @@ function! airline#highlighter#exec(group, colors)
|
||||||
\ get(colors, 4, '') != '' ? 'term='.colors[4] : '')
|
\ get(colors, 4, '') != '' ? 'term='.colors[4] : '')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:exec_separator(dict, from, to, invert)
|
function! s:exec_separator(dict, from, to)
|
||||||
let l:from = airline#themes#get_highlight(a:from)
|
let l:from = airline#themes#get_highlight(a:from)
|
||||||
let l:to = airline#themes#get_highlight(a:to)
|
let l:to = airline#themes#get_highlight(a:to)
|
||||||
let group = a:from.'_to_'.a:to
|
let group = a:from.'_to_'.a:to
|
||||||
let colors = [ l:to[1], l:from[1], l:to[3], l:from[3], a:invert ? 'inverse' : '' ]
|
let colors = [ l:to[1], l:from[1], l:to[3], l:from[3] ]
|
||||||
let a:dict[group] = colors
|
let a:dict[group] = colors
|
||||||
call airline#highlighter#exec(group, colors)
|
call airline#highlighter#exec(group, colors)
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -37,8 +37,8 @@ function! airline#highlighter#new()
|
||||||
call self.highlight(['normal'])
|
call self.highlight(['normal'])
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! highlighter.add_separator(from, to, invert)
|
function! highlighter.add_separator(from, to)
|
||||||
let self._separators[a:from.a:to] = [a:from, a:to, a:invert]
|
let self._separators[a:from.a:to] = [a:from, a:to]
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! highlighter.highlight(modes)
|
function! highlighter.highlight(modes)
|
||||||
|
@ -54,7 +54,7 @@ function! airline#highlighter#new()
|
||||||
|
|
||||||
" TODO: optimize this
|
" TODO: optimize this
|
||||||
for sep in items(self._separators)
|
for sep in items(self._separators)
|
||||||
call <sid>exec_separator(dict, sep[1][0].suffix, sep[1][1].suffix, sep[1][2])
|
call <sid>exec_separator(dict, sep[1][0].suffix, sep[1][1].suffix)
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
Loading…
Reference in New Issue