buflist: do not consider empty buffers to be excluded

currently, empty buffer names were still considered to match against the
exclude_path setting. That does not make sense, so skip the check for
empty bufnames.
This commit is contained in:
Christian Brabandt 2019-02-02 22:39:07 +01:00
parent 0a1f4cc910
commit 916d023c35
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 6 additions and 2 deletions

View File

@ -14,7 +14,11 @@ endfunction
" paths in excludes list
function! s:ExcludePaths(nr, exclude_paths)
let bpath = fnamemodify(bufname(a:nr), ":p")
let bname = bufname(a:nr)
if empty(bname)
return 0
endif
let bpath = fnamemodify(bname, ":p")
for f in a:exclude_paths
if bpath =~# f | return 1 | endif
endfor

View File

@ -358,7 +358,7 @@ The "!" prevents terminal buffers to appear in the tabline.
*airline#extensions#tabline#exclude_buffers*
Buffer numbers to be excluded from showing in the tabline (similar to
|airline#ignore_bufadd_pat|.
|airline#ignore_bufadd_pat|).
==============================================================================
EXTENSIONS *airline-extensions*