init in case :so MYVIMRC

This commit is contained in:
itchyny
2013-08-25 16:25:21 +09:00
parent eed071a151
commit a6198c4765

View File

@@ -3,7 +3,7 @@
" Version: 0.0 " Version: 0.0
" Author: itchyny " Author: itchyny
" License: MIT License " License: MIT License
" Last Change: 2013/08/24 19:16:30. " Last Change: 2013/08/25 16:24:57.
" ============================================================================= " =============================================================================
let s:save_cpo = &cpo let s:save_cpo = &cpo
@@ -13,13 +13,17 @@ let s:_ = 1
let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running') let s:is_win32term = (has('win32') || has('win64')) && !has('gui_running')
function! lightline#update() function! lightline#update()
if s:_ | call lightline#init() | endif try
let s = [lightline#statusline(0), lightline#statusline(1)] if s:_ | call lightline#init() | endif
let w = winnr() let s = [lightline#statusline(0), lightline#statusline(1)]
for n in range(1, winnr('$')) let w = winnr()
call setwinvar(n, '&statusline', s[n!=w]) for n in range(1, winnr('$'))
call setwinvar(n, 'lightline', n!=w) call setwinvar(n, '&statusline', s[n!=w])
endfor call setwinvar(n, 'lightline', n!=w)
endfor
catch
call lightline#init()
endtry
endfunction endfunction
function! lightline#update_once() function! lightline#update_once()