parent
a7daa507ab
commit
de678ed289
|
@ -82,7 +82,7 @@ function! PowerlineRegisterCachePurgerEvent(event)
|
|||
endfunction
|
||||
|
||||
augroup Powerline
|
||||
autocmd! ColorScheme * :exec s:powerline_pycmd 'powerline.renderer.reset_highlight()'
|
||||
autocmd! ColorScheme * :exec s:powerline_pycmd 'powerline.reset_highlight()'
|
||||
autocmd! VimEnter * :redrawstatus!
|
||||
autocmd! VimLeavePre * :exec s:powerline_pycmd 'powerline.shutdown()'
|
||||
augroup END
|
||||
|
|
|
@ -82,3 +82,14 @@ class VimPowerline(Powerline):
|
|||
@staticmethod
|
||||
def get_segment_info():
|
||||
return {}
|
||||
|
||||
def reset_highlight(self):
|
||||
try:
|
||||
self.renderer.reset_highlight()
|
||||
except AttributeError:
|
||||
# Renderer object appears only after first `.render()` call. Thus if
|
||||
# ColorScheme event happens before statusline is drawn for the first
|
||||
# time AttributeError will be thrown for the self.renderer. It is
|
||||
# fine to ignore it: no renderer == no colors to reset == no need to
|
||||
# do anything.
|
||||
pass
|
||||
|
|
Loading…
Reference in New Issue