mirror of
https://github.com/powerline/powerline.git
synced 2025-07-26 23:35:04 +02:00
Fix &stl reset to global value when new file is loaded
Fixes #241 Ref #240
This commit is contained in:
parent
b347d53b6d
commit
861f7dc179
@ -52,6 +52,9 @@ function! s:GetWinID(winnr)
|
|||||||
if empty(r)
|
if empty(r)
|
||||||
let r = s:pyeval('str(uuid.uuid4())')
|
let r = s:pyeval('str(uuid.uuid4())')
|
||||||
call setwinvar(a:winnr, 'window_id', r)
|
call setwinvar(a:winnr, 'window_id', r)
|
||||||
|
endif
|
||||||
|
" Without this condition it triggers unneeded statusline redraw
|
||||||
|
if getwinvar(a:winnr, '&statusline') isnot# '%!Powerline("'.r.'")'
|
||||||
call setwinvar(a:winnr, '&statusline', '%!Powerline("'.r.'")')
|
call setwinvar(a:winnr, '&statusline', '%!Powerline("'.r.'")')
|
||||||
endif
|
endif
|
||||||
return r
|
return r
|
||||||
@ -64,9 +67,11 @@ function! Powerline(window_id)
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! PowerlineNew()
|
function! PowerlineNew()
|
||||||
return Powerline(s:GetWinID(winnr()))
|
call map(range(1, winnr('$')), 's:GetWinID(v:val)')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Is immediately changed when Powerline() function is run. Good for global
|
||||||
|
" value.
|
||||||
set statusline=%!PowerlineNew()
|
set statusline=%!PowerlineNew()
|
||||||
|
|
||||||
function! PowerlineRegisterCachePurgerEvent(event)
|
function! PowerlineRegisterCachePurgerEvent(event)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user