diff --git a/powerline/ext/vim/renderer.py b/powerline/ext/vim/renderer.py index 44058379..bab06ae9 100644 --- a/powerline/ext/vim/renderer.py +++ b/powerline/ext/vim/renderer.py @@ -36,7 +36,6 @@ class VimRenderer(Renderer): if current: mode = vim_mode() contents_override = None - self.window_cache[window_id] = {segment['key']: segment['contents'] for segment in self.segments if segment['type'] == 'function'} else: mode = 'nc' contents_override = self.window_cache.get(window_id) @@ -44,6 +43,9 @@ class VimRenderer(Renderer): statusline = super(VimRenderer, self).render(mode, width=winwidth, contents_override=contents_override) statusline = statusline.replace(self.PERCENT_PLACEHOLDER, '%%') + if current: + self.window_cache[window_id] = {segment['key']: segment['contents'] for segment in self.segments if segment['type'] == 'function'} + return statusline def hl(self, fg=None, bg=None, attr=None):