From 370379a48624743a71d751fdd25868a876ea76e4 Mon Sep 17 00:00:00 2001 From: Marco Hinz Date: Sat, 7 Jan 2017 17:36:54 +0100 Subject: [PATCH] health: completion for :CheckHealth --- runtime/plugin/health.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/runtime/plugin/health.vim b/runtime/plugin/health.vim index 3c8e509acd..e3482cb0fe 100644 --- a/runtime/plugin/health.vim +++ b/runtime/plugin/health.vim @@ -1 +1,8 @@ -command! -nargs=* CheckHealth call health#check([]) +function! s:complete(lead, _line, _pos) abort + return sort(filter(map(globpath(&runtimepath, 'autoload/health/*', 1, 1), + \ 'fnamemodify(v:val, ":t:r")'), + \ 'empty(a:lead) || v:val[:strlen(a:lead)-1] ==# a:lead')) +endfunction + +command! -nargs=* -complete=customlist,s:complete CheckHealth + \ call health#check([])