Cleanup code and comments

This commit is contained in:
Kim Silkebækken 2012-12-15 19:36:14 +01:00
parent 0bf23adbcc
commit 3b19dac9e7
3 changed files with 1 additions and 7 deletions

View File

@ -26,10 +26,6 @@ endfunction
function! s:UpdateAllWindows()
for winnr in range(1, winnr('$'))
" getwinvar() returns empty string for undefined variables. Use
" has_key(getwinvar(winnr, ''), 'window_id') if you care about
" variable being really defined (currently with w:window_id=='' it
" will throw E706: variable type mismatch).
if getwinvar(winnr, 'window_id') is# ''
call setwinvar(winnr, 'window_id', s:pyeval('str(uuid.uuid4())'))
endif

View File

@ -36,8 +36,7 @@ class VimRenderer(Renderer):
if current:
mode = vim_mode()
contents_override = None
contents_cached = {segment['key']: segment['contents'] for segment in self.segments if segment['type'] == 'function'}
self.window_cache[window_id] = contents_cached
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)

View File

@ -34,7 +34,6 @@ class Renderer(object):
provided they will fill the remaining space until the desired width is
reached.
'''
theme = self.get_theme()
segments = theme.get_segments(mode, contents_override)