From f7cbf8c42959689461e6dfcc92b4e453cb4ae17c Mon Sep 17 00:00:00 2001 From: Vincenzo Di Massa Date: Sun, 2 May 2021 22:52:45 +0200 Subject: [PATCH] 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 --- autoload/airline/extensions.vim | 2 +- autoload/airline/util.vim | 2 +- plugin/airline.vim | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/autoload/airline/extensions.vim b/autoload/airline/extensions.vim index 1eb6f956..71a2d64f 100644 --- a/autoload/airline/extensions.vim +++ b/autoload/airline/extensions.vim @@ -465,7 +465,7 @@ function! airline#extensions#load() if !get(g:, 'airline#extensions#disable_rtp_load', 0) " load all other extensions, which are not part of the default distribution. " (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 " that they might not get resolved properly (see #187) if stridx(tolower(resolve(fnamemodify(file, ':p'))), s:script_path) < 0 diff --git a/autoload/airline/util.vim b/autoload/airline/util.vim index 4ca5778d..c090172e 100644 --- a/autoload/airline/util.vim +++ b/autoload/airline/util.vim @@ -182,7 +182,7 @@ function! airline#util#doautocmd(event) endfunction 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'] : [])) endfunction diff --git a/plugin/airline.vim b/plugin/airline.vim index f5ce8662..64dfecac 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -239,7 +239,7 @@ endfu function! s:airline_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")') if empty(files) echo "No extensions loaded"