mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-02-21 07:40:13 +08:00
Check the value of the 'stl' setting on SessionLoadPost
Restoring a session using vim -S with 'sessionopts' including options, might overwrite the statusline function. fixes #1131
This commit is contained in:
parent
86e7d19df1
commit
a5f7b9520a
@ -41,6 +41,7 @@ function! s:on_window_changed()
|
||||
" different autocommands.
|
||||
let l:key = [bufnr('%'), winnr(), winnr('$')]
|
||||
if get(t:, 'airline_last_window_changed', []) == l:key
|
||||
\ && &stl =~? 'airline#statusline(\d\+)$'
|
||||
return
|
||||
endif
|
||||
let t:airline_last_window_changed = l:key
|
||||
@ -86,7 +87,7 @@ function! s:airline_toggle()
|
||||
autocmd CmdwinLeave * call airline#remove_statusline_func('airline#cmdwinenter')
|
||||
|
||||
autocmd GUIEnter,ColorScheme * call <sid>on_colorscheme_changed()
|
||||
autocmd VimEnter,WinEnter,BufWinEnter,FileType,BufUnload,VimResized *
|
||||
autocmd SessionLoadPost,VimEnter,WinEnter,BufWinEnter,FileType,BufUnload,VimResized *
|
||||
\ call <sid>on_window_changed()
|
||||
|
||||
autocmd TabEnter * :unlet! w:airline_lastmode
|
||||
|
Loading…
x
Reference in New Issue
Block a user