mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2024-12-05 00:13:34 +08:00
Revert "inactivate existing statusline without building a new one."
This reverts commit 53b856b0c5
.
This commit is contained in:
parent
511411d55e
commit
04daa66b48
|
@ -94,12 +94,10 @@ endfunction
|
|||
|
||||
function! airline#update_statusline()
|
||||
for nr in filter(range(1, winnr('$')), 'v:val != winnr()')
|
||||
if airline#util#getwinvar(nr, 'airline_active', 0)
|
||||
call setwinvar(nr, 'airline_active', 0)
|
||||
let stl = getwinvar(nr, '&statusline')
|
||||
let line = substitute(stl, '%#.\{-}\ze#', '\0_inactive', 'g')
|
||||
call setwinvar(nr, '&statusline', line)
|
||||
endif
|
||||
call setwinvar(nr, 'airline_active', 0)
|
||||
let context = { 'winnr': nr, 'active': 0 }
|
||||
let builder = airline#builder#new(context, s:highlighter)
|
||||
call setwinvar(nr, '&statusline', airline#get_statusline(builder, nr, 0))
|
||||
endfor
|
||||
|
||||
let w:airline_active = 1
|
||||
|
@ -111,8 +109,8 @@ function! airline#update_statusline()
|
|||
endfor
|
||||
|
||||
let context = { 'winnr': winnr(), 'active': 1 }
|
||||
let builder = airline#builder#new(s:highlighter)
|
||||
let err = airline#util#exec_funcrefs(g:airline_statusline_funcrefs, builder, context)
|
||||
let builder = airline#builder#new(context, s:highlighter)
|
||||
let err = airline#util#exec_funcrefs(g:airline_statusline_funcrefs, builder)
|
||||
if err == 0
|
||||
call setwinvar(winnr(), '&statusline', airline#get_statusline(builder, winnr(), 1))
|
||||
elseif err == 1
|
||||
|
|
|
@ -24,11 +24,15 @@ function! s:prototype.add_raw(text)
|
|||
endfunction
|
||||
|
||||
function! s:prototype.build()
|
||||
if !self._context.active
|
||||
let self._line = substitute(self._line, '%#.\{-}\ze#', '\0_inactive', 'g')
|
||||
endif
|
||||
return self._line
|
||||
endfunction
|
||||
|
||||
function! airline#builder#new(highlighter)
|
||||
function! airline#builder#new(context, highlighter)
|
||||
let builder = copy(s:prototype)
|
||||
let builder._context = a:context
|
||||
let builder._highlighter = a:highlighter
|
||||
let builder._side = 1
|
||||
let builder._curgroup = ''
|
||||
|
|
Loading…
Reference in New Issue
Block a user