rplugin: Improve remote plugins detection messages #2769

This commit is contained in:
Shougo Matsushita 2015-05-30 18:33:45 +09:00 committed by Justin M. Keyes
parent deb65188ac
commit 7dc241ac78

View File

@ -127,11 +127,10 @@ function! s:RegistrationCommands(host)
call remote#host#RegisterClone(host_id, a:host) call remote#host#RegisterClone(host_id, a:host)
let pattern = s:plugin_patterns[a:host] let pattern = s:plugin_patterns[a:host]
let paths = globpath(&rtp, 'rplugin/'.a:host.'/'.pattern, 0, 1) let paths = globpath(&rtp, 'rplugin/'.a:host.'/'.pattern, 0, 1)
if len(paths) < 1 if empty(paths)
echom "Could not find any plugins when attempting to register plugin "
\ ."commands. See :he remote-plugin"
return [] return []
endif endif
for path in paths for path in paths
call remote#host#RegisterPlugin(host_id, path, []) call remote#host#RegisterPlugin(host_id, path, [])
endfor endfor
@ -151,6 +150,9 @@ function! s:RegistrationCommands(host)
endfor endfor
call add(lines, " \\ ])") call add(lines, " \\ ])")
endfor endfor
echomsg printf("remote/host: %s host registered plugins %s",
\ a:host, string(map(copy(paths), "fnamemodify(v:val, ':t')")))
" Delete the temporary host clone " Delete the temporary host clone
call rpcstop(s:hosts[host_id].channel) call rpcstop(s:hosts[host_id].channel)
call remove(s:hosts, host_id) call remove(s:hosts, host_id)