mirror of
https://github.com/vim-airline/vim-airline.git
synced 2026-08-12 19:06:56 +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")
|
echo printf("%-15s\t%s\t%s", "Extension", "Extern", "Status")
|
||||||
echohl Normal
|
echohl Normal
|
||||||
let set=[]
|
let set=[]
|
||||||
|
let not_loaded=[]
|
||||||
for ext in sort(files)
|
for ext in sort(files)
|
||||||
if index(set, ext) > -1
|
" prevent duplicates
|
||||||
|
if index(set + not_loaded, ext) > -1
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
let indx=match(loaded, '^'.ext.'\*\?$')
|
let indx=match(loaded, '^'.ext.'\*\?$')
|
||||||
let external = (indx > -1 && loaded[indx] =~ '\*$')
|
if indx == -1
|
||||||
echo printf("%-15s\t%s\t%sloaded", ext, external, indx == -1 ? 'not ' : '')
|
call add(not_loaded, ext)
|
||||||
|
continue
|
||||||
|
endif
|
||||||
call add(set, ext)
|
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
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user