Skip to content

bad behaviour with Powerline #3

lyokha opened this Issue Mar 26, 2012 · 2 comments

2 participants

lyokha commented Mar 26, 2012


Nice plugin! Only i found that it breaks Powerline status line when :FinishRecovery issued. The problem arises from s:ModifySTL() when argument enable is 0. Actually it tries to restore &stl from value of s:ostl - but this value, created upon plugin's start has nothing to do with value of &stl on :FinishRecovery moment if Powerline is installed - Powerline just changes it to something like %!Pl#Statusline(0,1) and restoring &stl from older s:ostl breaks Powerline status line.

Some workaround could be: store also new value of &stl in variable, say, s:nstl and then, when restoring &stl, check if it changed - if it changed (e.g. By Powerline) then just do nothing.

fu! s:ModifySTL(enable) "{{{1
if a:enable
" Inject some info into the statusline
:let s:ostl=&stl
:let s:nstl=substitute(&stl, '%f', "\0 %{exists('b:mod')?('['.b:mod.']') : ''}", 'g')
:let stl=s:nstl
" Restore old statusline setting
if exists("s:ostl") && s:nstl == &stl
let &stl=s:ostl

This workaround won't break old behaviour and will fix the issue with Powerline (it works for me).

lyokha commented Mar 26, 2012

Sorry, there is a typo, printed

:let stl=s:nstl

must be

:let &stl=s:nstl

@chrisbra chrisbra added a commit that referenced this issue Mar 26, 2012
@chrisbra fix issue #3 e582f4f
@chrisbra chrisbra closed this Mar 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.