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
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