Fix width used for tabline

Fixes #1033
This commit is contained in:
ZyX 2014-08-29 18:32:58 +04:00
parent e609bdf514
commit 125f309724
2 changed files with 18 additions and 3 deletions

View File

@ -2,7 +2,7 @@
from __future__ import absolute_import, unicode_literals
from powerline.bindings.vim import vim_get_func, environ, current_tabpage
from powerline.bindings.vim import vim_get_func, vim_getoption, environ, current_tabpage
from powerline.renderer import Renderer
from powerline.colorscheme import ATTR_BOLD, ATTR_ITALIC, ATTR_UNDERLINE
from powerline.theme import Theme
@ -108,7 +108,10 @@ class VimRenderer(Renderer):
)
segment_info['tabnr'] = segment_info['tabpage'].number
segment_info['bufnr'] = segment_info['buffer'].number
winwidth = segment_info['window'].width
if is_tabline:
winwidth = int(vim_getoption('columns'))
else:
winwidth = segment_info['window'].width
statusline = super(VimRenderer, self).render(
mode=mode,

View File

@ -23,7 +23,7 @@ tabonly!
try
let result = eval(&tabline[2:])
catch
call writefile(['Exception while evaluating &tabline', v:exception], 'message.fail')
call writefile(['Exception while evaluating &tabline (2)', v:exception], 'message.fail')
cquit
endtry
@ -32,4 +32,16 @@ if result isnot# '%#Pl_240_5789784_235_2500134_NONE# 1 %#Pl_240_5789784_235_25
cquit
endif
try
vsplit
let result = eval(&tabline[2:])
catch
call writefile(['Exception while evaluating &tabline (3)', v:exception], 'message.fail')
endtry
if result isnot# '%#Pl_240_5789784_235_2500134_NONE# 1 %#Pl_240_5789784_235_2500134_NONE#./%#Pl_244_8421504_235_2500134_bold#abc %#Pl_244_8421504_235_2500134_NONE# %#Pl_240_5789784_235_2500134_NONE#2 %#Pl_240_5789784_235_2500134_NONE#./%#Pl_244_8421504_235_2500134_bold#def %#Pl_235_2500134_240_5789784_NONE# %#Pl_250_12369084_240_5789784_NONE#./%#Pl_231_16777215_240_5789784_bold#ghi %#Pl_240_5789784_236_3158064_NONE# %#Pl_231_16777215_236_3158064_NONE#                                           %#Pl_252_13684944_236_3158064_NONE# %#Pl_235_2500134_252_13684944_bold# Bufs '
call writefile(['Unexpected tabline (3)', result], 'message.fail')
cquit
endif
qall!