extensions: Group output of :AirlineExtension by loaded/not-loaded

Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
Christian Brabandt
2026-04-12 15:30:10 +00:00
parent 7d019cd8f5
commit 493a5b4895
+12 -3
View File
@@ -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