mirror of
https://github.com/vim-airline/vim-airline.git
synced 2025-12-06 12:14:24 +08:00
highlighter: remove stale separator entries on buffer unload
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
Some checks failed
CI / Test (v7.4) (push) Has been cancelled
CI / Test (v8.0.0000) (push) Has been cancelled
CI / Test (v8.1.0000) (push) Has been cancelled
CI / Test (v8.2.0000) (push) Has been cancelled
CI / Test (v8.2.1000) (push) Has been cancelled
CI / Test (v9.0.0000) (push) Has been cancelled
CI / Test (v9.1.0000) (push) Has been cancelled
reviewdog / runner / vint (push) Has been cancelled
fixes: #2701 Co-authored-by: Mina Nagy Zaki <mnzaki@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -48,6 +48,7 @@ function! s:init()
|
||||
endfunction
|
||||
|
||||
let s:active_winnr = -1
|
||||
|
||||
function! s:on_window_changed(event)
|
||||
" don't trigger for Vim popup windows
|
||||
if &buftype is# 'popup'
|
||||
@@ -67,11 +68,20 @@ function! s:on_window_changed(event)
|
||||
\ && &ft !~? 'gitcommit'
|
||||
" fugitive is special, it changes names and filetypes several times,
|
||||
" make sure the caching does not get into its way
|
||||
if a:event ==# 'BufUnload'
|
||||
" in the BufUnload event, make sure the cacheing does not prevent
|
||||
" removing stale entries
|
||||
call airline#highlighter#remove_separators_for_bufnr(expand('<abuf>'))
|
||||
endif
|
||||
return
|
||||
endif
|
||||
let g:airline_last_window_changed = l:key
|
||||
call s:init()
|
||||
call airline#update_statusline()
|
||||
|
||||
if a:event ==# 'BufUnload'
|
||||
call airline#highlighter#remove_separators_for_bufnr(expand('<abuf>'))
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:on_focus_gained()
|
||||
|
||||
Reference in New Issue
Block a user