change events for updating the statusline, from BufWinEnter,FileType to BufEnter (close #352)

- fix the active statusline after updating the quickfix/location list
- use g:qf_disable_statusline to disable the statusline of the default ftplugin
- for before Vim 8.1.1715, keep using FileType event to overwrite the statusline of the quickfix window
This commit is contained in:
itchyny
2019-07-30 18:52:28 +09:00
parent f2a1f47c85
commit 1afe1e9bd5
5 changed files with 43 additions and 4 deletions

View File

@@ -2,7 +2,7 @@
" Filename: autoload/lightline.vim
" Author: itchyny
" License: MIT License
" Last Change: 2019/07/20 12:00:00.
" Last Change: 2019/07/30 12:00:00.
" =============================================================================
let s:save_cpo = &cpo
@@ -46,7 +46,10 @@ function! lightline#enable() abort
call lightline#update()
augroup lightline
autocmd!
autocmd WinEnter,BufWinEnter,FileType,SessionLoadPost * call lightline#update()
autocmd WinEnter,BufEnter,SessionLoadPost * call lightline#update()
if !has('patch-8.1.1715')
autocmd FileType qf call lightline#update()
endif
autocmd SessionLoadPost * call lightline#highlight()
autocmd ColorScheme * if !has('vim_starting') || expand('<amatch>') !=# 'macvim'
\ | call lightline#update() | call lightline#highlight() | endif