From 852add00b8e5969d332fe5eb274e28665c6a0dc7 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Sun, 13 Nov 2022 15:41:15 +0800 Subject: [PATCH] perf(health): improve layer health checking --- autoload/SpaceVim/health.vim | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/autoload/SpaceVim/health.vim b/autoload/SpaceVim/health.vim index d5cf4ec50..bf7afcbaf 100644 --- a/autoload/SpaceVim/health.vim +++ b/autoload/SpaceVim/health.vim @@ -30,18 +30,13 @@ endfunction function! s:check_layers() abort - let report = [] + let report = ['Checking SpaceVim layer health:'] for layer in SpaceVim#layers#get() try - call extend(report, [layer . ' layer health:', '']) - let result = SpaceVim#layers#{layer}#health() ? ['ok', ''] : ['failed', ''] - call extend(report,result) + let result = SpaceVim#layers#{layer}#health() ? 'ok' : 'failed' + call extend(report, [' - `' . layer . '`:' . result]) catch /^Vim\%((\a\+)\)\=:E117/ - call extend(report,[ - \ '', - \ ' There is no function: SpaceVim#layers#' . layer . '#health()', - \ '', - \ ]) + call extend(report, [' - `' . layer . '`: can not find function: SpaceVim#layers#' . layer . '#health()']) endtry endfor return report