1
0
Fork 0
mirror of synced 2024-06-05 08:51:10 -04:00
ultimate-vim/sources_non_forked/vim-airline/autoload/airline/extensions/tabline/buflist.vim

43 lines
1.1 KiB
VimL
Raw Normal View History

2015-02-24 05:45:22 -05:00
" MIT License. Copyright (c) 2013-2015 Bailey Ling.
" vim: et ts=2 sts=2 sw=2
let s:excludes = get(g:, 'airline#extensions#tabline#excludes', [])
2015-07-13 06:22:46 -04:00
let s:exclude_preview = get(g:, 'airline#extensions#tabline#exclude_preview', 1)
2015-02-24 05:45:22 -05:00
function! airline#extensions#tabline#buflist#invalidate()
unlet! s:current_buffer_list
endfunction
function! airline#extensions#tabline#buflist#list()
if exists('s:current_buffer_list')
return s:current_buffer_list
endif
let buffers = []
let cur = bufnr('%')
for nr in range(1, bufnr('$'))
if buflisted(nr) && bufexists(nr)
let toadd = 1
for ex in s:excludes
if match(bufname(nr), ex) >= 0
let toadd = 0
break
endif
endfor
if getbufvar(nr, 'current_syntax') == 'qf'
let toadd = 0
endif
2015-07-13 06:22:46 -04:00
if s:exclude_preview && getbufvar(nr, '&bufhidden') == 'wipe' && getbufvar(nr, '&buftype') == 'nofile'
let toadd = 0
endif
2015-02-24 05:45:22 -05:00
if toadd
call add(buffers, nr)
endif
endif
endfor
let s:current_buffer_list = buffers
return buffers
endfunction