Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: tabline not updated after bbye's bdelete #20

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 17 additions & 13 deletions plugin/bufferline.vim
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ augroup bufferline
au!
au BufReadPost,BufNewFile * call <SID>on_buffer_open(expand('<abuf>'))
au BufDelete * call <SID>on_buffer_close(expand('<abuf>'))
au Colorscheme * call <SID>setup_hl()
augroup END

function! s:did_load (...)
augroup bufferline_update
au!
au BufNew,BufDelete * call bufferline#update()
au BufWinEnter,BufEnter * call bufferline#update()
au BufWritePost * call bufferline#update()
au TabEnter,TabNewEntered * call bufferline#update()
au SessionLoadPost * call bufferline#update()
au WinEnter,WinLeave * call bufferline#update()
au WinClosed * call bufferline#update()
augroup END

call bufferline#update()
augroup bufferline_update
au!
au BufNew * call bufferline#update()
au BufWinEnter * call bufferline#update()
au BufWritePost * call bufferline#update()
au SessionLoadPost * call bufferline#update()
au WinLeave * call bufferline#update()
au WinClosed * call bufferline#update()
augroup END

call bufferline#update()
endfunc
call timer_start(100, function('s:did_load'))

Expand Down Expand Up @@ -135,7 +135,7 @@ let s:empty_bufnr = nvim_create_buf(0, 1)
"========================

function! bufferline#update()
let &tabline = bufferline#render()
call timer_start(1, function('s:on_update'), { 'repeat': 1 })
endfu

function! bufferline#render()
Expand Down Expand Up @@ -353,6 +353,10 @@ endfunc
" Section: Event handlers
"========================

function! s:on_update(timer)
let &tabline = bufferline#render()
endfu

function! s:on_buffer_open(abuf)
let buffer = bufnr()
" Buffer might be listed but not loaded, thus why it has already a letter
Expand Down