diff --git a/autoload/airline/extensions/tabline/buffers.vim b/autoload/airline/extensions/tabline/buffers.vim index df6c93d..96b1a87 100644 --- a/autoload/airline/extensions/tabline/buffers.vim +++ b/autoload/airline/extensions/tabline/buffers.vim @@ -37,6 +37,8 @@ function! airline#extensions#tabline#buffers#on() augroup airline_tabline_buffers autocmd! autocmd BufDelete * call airline#extensions#tabline#buffers#invalidate() + autocmd User BufMRUChange call airline#extensions#tabline#buflist#invalidate() + autocmd User BufMRUChange call airline#extensions#tabline#buffers#invalidate() augroup END endfunction diff --git a/autoload/airline/extensions/tabline/buflist.vim b/autoload/airline/extensions/tabline/buflist.vim index ac17878..6ee23ed 100644 --- a/autoload/airline/extensions/tabline/buflist.vim +++ b/autoload/airline/extensions/tabline/buflist.vim @@ -13,11 +13,13 @@ function! airline#extensions#tabline#buflist#list() return s:current_buffer_list endif + let list = (exists('g:did_bufmru') && g:did_bufmru) ? BufMRUList() : range(1, bufnr("$")) + let buffers = [] " If this is too slow, we can switch to a different algorithm. " Basically branch 535 already does it, but since it relies on " BufAdd autocommand, I'd like to avoid this if possible. - for nr in range(1, bufnr('$')) + for nr in list if buflisted(nr) " Do not add to the bufferlist, if either " 1) buffername matches exclude pattern