mirror of
https://github.com/neovim/neovim.git
synced 2025-12-17 03:45:42 +00:00
rplugin: Manifest file name fallback (#4935)
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
let s:hosts = {}
|
let s:hosts = {}
|
||||||
let s:plugin_patterns = {}
|
let s:plugin_patterns = {}
|
||||||
let s:remote_plugins_manifest = fnamemodify(expand($MYVIMRC, 1), ':h')
|
|
||||||
\.'/.'.fnamemodify($MYVIMRC, ':t').'-rplugin~'
|
|
||||||
let s:plugins_for_host = {}
|
let s:plugins_for_host = {}
|
||||||
|
|
||||||
|
|
||||||
@@ -120,9 +118,18 @@ function! remote#host#RegisterPlugin(host, path, specs) abort
|
|||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
function! s:GetManifest() abort
|
||||||
|
let prefix = exists('$MYVIMRC')
|
||||||
|
\ ? $MYVIMRC
|
||||||
|
\ : matchstr(get(split(capture('scriptnames'), '\n'), 0, ''), '\f\+$')
|
||||||
|
return fnamemodify(expand(prefix, 1), ':h')
|
||||||
|
\.'/.'.fnamemodify(prefix, ':t').'-rplugin~'
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
function! remote#host#LoadRemotePlugins() abort
|
function! remote#host#LoadRemotePlugins() abort
|
||||||
if filereadable(s:remote_plugins_manifest)
|
if filereadable(s:GetManifest())
|
||||||
exe 'source '.s:remote_plugins_manifest
|
exe 'source '.s:GetManifest()
|
||||||
endif
|
endif
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -194,9 +201,9 @@ function! remote#host#UpdateRemotePlugins() abort
|
|||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
call writefile(commands, s:remote_plugins_manifest)
|
call writefile(commands, s:GetManifest())
|
||||||
echomsg printf('remote/host: generated the manifest file in "%s"',
|
echomsg printf('remote/host: generated the manifest file in "%s"',
|
||||||
\ s:remote_plugins_manifest)
|
\ s:GetManifest())
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user