mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-04-27 09:01:24 +08:00
extensions: Group output of :AirlineExtension by loaded/not-loaded
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
+12
-3
@@ -272,14 +272,23 @@ function! s:airline_extensions()
|
||||
echo printf("%-15s\t%s\t%s", "Extension", "Extern", "Status")
|
||||
echohl Normal
|
||||
let set=[]
|
||||
let not_loaded=[]
|
||||
for ext in sort(files)
|
||||
if index(set, ext) > -1
|
||||
" prevent duplicates
|
||||
if index(set + not_loaded, ext) > -1
|
||||
continue
|
||||
endif
|
||||
let indx=match(loaded, '^'.ext.'\*\?$')
|
||||
let external = (indx > -1 && loaded[indx] =~ '\*$')
|
||||
echo printf("%-15s\t%s\t%sloaded", ext, external, indx == -1 ? 'not ' : '')
|
||||
if indx == -1
|
||||
call add(not_loaded, ext)
|
||||
continue
|
||||
endif
|
||||
call add(set, ext)
|
||||
let external=(loaded[indx] =~ '\*$')
|
||||
echo printf("%-15s\t%s\tloaded", ext, external)
|
||||
endfor
|
||||
for ext in not_loaded
|
||||
echo printf("%-15s\t%s\tnot loaded", ext, 0)
|
||||
endfor
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user