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