retrieve the width of the window from g:lightline if available (for injection from the tests)

This commit is contained in:
itchyny
2016-03-20 00:58:31 +09:00
parent 9139d78f4b
commit 8911dfacd4

View File

@@ -2,7 +2,7 @@
" Filename: autoload/lightline.vim " Filename: autoload/lightline.vim
" Author: itchyny " Author: itchyny
" License: MIT License " License: MIT License
" Last Change: 2016/03/20 00:53:38. " Last Change: 2016/03/20 00:56:45.
" ============================================================================= " =============================================================================
let s:save_cpo = &cpo let s:save_cpo = &cpo
@@ -457,7 +457,7 @@ function! lightline#tabline() abort
return s:tabline return s:tabline
endfunction endfunction
let s:winwidth = winwidth(0) let s:winwidth = get(get(g:, 'lightline', {}), 'winwidth', winwidth(0))
function! lightline#tabs() abort function! lightline#tabs() abort
let [x, y, z] = [[], [], []] let [x, y, z] = [[], [], []]
let nr = tabpagenr() let nr = tabpagenr()