glob return results without removing wildignore matches

Ignore 'wildignore' and 'suffixes' when globbing for themes and extensions.

This can be a problem when you have a wildignore containing *.vim.

closes #2375
This commit is contained in:
Vincenzo Di Massa 2021-05-02 22:52:45 +02:00 committed by Christian Brabandt
parent 76e42284e9
commit f7cbf8c429
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
3 changed files with 3 additions and 3 deletions

View File

@ -465,7 +465,7 @@ function! airline#extensions#load()
if !get(g:, 'airline#extensions#disable_rtp_load', 0) if !get(g:, 'airline#extensions#disable_rtp_load', 0)
" load all other extensions, which are not part of the default distribution. " load all other extensions, which are not part of the default distribution.
" (autoload/airline/extensions/*.vim outside of our s:script_path). " (autoload/airline/extensions/*.vim outside of our s:script_path).
for file in split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n") for file in split(globpath(&rtp, 'autoload/airline/extensions/*.vim', 1), "\n")
" we have to check both resolved and unresolved paths, since it's possible " we have to check both resolved and unresolved paths, since it's possible
" that they might not get resolved properly (see #187) " that they might not get resolved properly (see #187)
if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0 if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0

View File

@ -182,7 +182,7 @@ function! airline#util#doautocmd(event)
endfunction endfunction
function! airline#util#themes(match) function! airline#util#themes(match)
let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:match.'*.vim'), "\n") let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:match.'*.vim', 1), "\n")
return sort(map(files, 'fnamemodify(v:val, ":t:r")') + ('random' =~ a:match ? ['random'] : [])) return sort(map(files, 'fnamemodify(v:val, ":t:r")') + ('random' =~ a:match ? ['random'] : []))
endfunction endfunction

View File

@ -239,7 +239,7 @@ endfu
function! s:airline_extensions() function! s:airline_extensions()
let loaded = airline#extensions#get_loaded_extensions() let loaded = airline#extensions#get_loaded_extensions()
let files = split(globpath(&rtp, "autoload/airline/extensions/*.vim"), "\n") let files = split(globpath(&rtp, 'autoload/airline/extensions/*.vim', 1), "\n")
call map(files, 'fnamemodify(v:val, ":t:r")') call map(files, 'fnamemodify(v:val, ":t:r")')
if empty(files) if empty(files)
echo "No extensions loaded" echo "No extensions loaded"