Add a separate function for returning all available themes

This commit is contained in:
Christian Brabandt 2018-11-13 22:14:13 +01:00
parent 49671d0a11
commit b20e181bc8
No known key found for this signature in database
GPG Key ID: F3F92DA383FDDE09
2 changed files with 6 additions and 2 deletions

View File

@ -124,3 +124,8 @@ endfunction
function! airline#util#doautocmd(event)
exe printf("silent doautocmd %s User %s", s:nomodeline, a:event)
endfunction
function! airline#util#themes(match)
let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:match.'*'), "\n")
return map(files, 'fnamemodify(v:val, ":t:r")')
endfunction

View File

@ -146,8 +146,7 @@ function! s:airline_toggle()
endfunction
function! s:get_airline_themes(a, l, p)
let files = split(globpath(&rtp, 'autoload/airline/themes/'.a:a.'*'), "\n")
return map(files, 'fnamemodify(v:val, ":t:r")')
return airline#util#themes(a:a)
endfunction
function! s:airline_theme(...)