From 493a5b489532dd4ed3801a7c005d669ef8d010f6 Mon Sep 17 00:00:00 2001 From: Christian Brabandt Date: Sun, 12 Apr 2026 15:30:10 +0000 Subject: [PATCH] extensions: Group output of :AirlineExtension by loaded/not-loaded Signed-off-by: Christian Brabandt --- plugin/airline.vim | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/plugin/airline.vim b/plugin/airline.vim index 8e472692..845743c1 100644 --- a/plugin/airline.vim +++ b/plugin/airline.vim @@ -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