mirror of
https://github.com/itchyny/lightline.vim.git
synced 2025-11-14 22:43:50 -05:00
use negative logic for lightline#statusline
This commit is contained in:
@@ -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))
|
||||||
|
|||||||
Reference in New Issue
Block a user