use negative logic for lightline#statusline

This commit is contained in:
itchyny
2013-08-22 04:45:31 +09:00
parent b8965f8805
commit b410186031

View File

@@ -5,12 +5,12 @@ let s:_ = 1
function! lightline#update(...) function! lightline#update(...)
if s:_ | call lightline#init() | endif if s:_ | call lightline#init() | endif
let s = lightline#statusline(0) let s = lightline#statusline(1)
for nr in filter(range(1, winnr('$')), 'v:val != winnr()') for nr in filter(range(1, winnr('$')), 'v:val != winnr()')
call setwinvar(nr, '&statusline', s) call setwinvar(nr, '&statusline', s)
call setwinvar(nr, 'lightline', 1) call setwinvar(nr, 'lightline', 1)
endfor endfor
let s = lightline#statusline(1) let s = lightline#statusline(0)
call setwinvar(winnr(), '&statusline', s) call setwinvar(winnr(), '&statusline', s)
call setwinvar(winnr(), 'lightline', 0) call setwinvar(winnr(), 'lightline', 0)
endfunction endfunction
@@ -126,9 +126,9 @@ function! lightline#subseparator(x, y, s)
endif endif
endfunction endfunction
function! lightline#statusline(active) function! lightline#statusline(inactive)
let _ = '' let _ = ''
let mode = a:active ? 'active' : 'inactive' let mode = a:inactive ? 'inactive' : 'active'
let left = has_key(g:lightline, mode) ? g:lightline[mode].left : g:lightline.active.left let left = has_key(g:lightline, mode) ? g:lightline[mode].left : g:lightline.active.left
let right = has_key(g:lightline, mode) ? g:lightline[mode].right : g:lightline.active.right let right = has_key(g:lightline, mode) ? g:lightline[mode].right : g:lightline.active.right
for i in range(len(left)) for i in range(len(left))