rplugin: Don't error if plugin is registered before host #2961

This makes it possible to register a lazy loaded host in a plugin/ file.
Previously this caused an error on restart after :UpdateRemotePlugins
This commit is contained in:
Björn Linse 2015-07-05 19:21:08 +02:00
parent ba2f7a9310
commit 73d9cd85df

View File

@ -81,7 +81,7 @@ function! remote#host#RegisterPlugin(host, path, specs)
endif
endfor
if remote#host#IsRunning(a:host)
if has_key(s:hosts, a:host) && remote#host#IsRunning(a:host)
" For now we won't allow registration of plugins when the host is already
" running.
throw 'Host "'.a:host.'" is already running'