mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
host.vim: s:GetManifestPath(): Remove for-loop.
Without the for-loop it is easier to follow, more explicit, and fewer lines.
This commit is contained in:
parent
966f1abd8b
commit
4b0b391f9f
@ -126,13 +126,9 @@ function! s:GetManifestPath() abort
|
|||||||
return fnamemodify($NVIM_RPLUGIN_MANIFEST, ':p')
|
return fnamemodify($NVIM_RPLUGIN_MANIFEST, ':p')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let preferred = has('win32')
|
let dest = has('win32') ? '$LOCALAPPDATA' : '$XDG_DATA_HOME'
|
||||||
\ ? ['$LOCALAPPDATA', '~/AppData/Local']
|
if !exists(dest)
|
||||||
\ : ['$XDG_DATA_HOME', '~/.local/share']
|
let dest = has('win32') ? '~/AppData/Local' : '~/.local/share'
|
||||||
|
|
||||||
for dest in preferred
|
|
||||||
if dest[0] == '$' && !exists(dest)
|
|
||||||
continue
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let dest = fnamemodify(expand(dest), ':p')
|
let dest = fnamemodify(expand(dest), ':p')
|
||||||
@ -140,9 +136,7 @@ function! s:GetManifestPath() abort
|
|||||||
let dest .= 'nvim/'
|
let dest .= 'nvim/'
|
||||||
call mkdir(dest, 'p', 700)
|
call mkdir(dest, 'p', 700)
|
||||||
let manifest_base = dest
|
let manifest_base = dest
|
||||||
break
|
|
||||||
endif
|
endif
|
||||||
endfor
|
|
||||||
|
|
||||||
return manifest_base.'rplugin.vim'
|
return manifest_base.'rplugin.vim'
|
||||||
endfunction
|
endfunction
|
||||||
|
@ -130,9 +130,9 @@ like this: It's a way to provide IDE capabilities in Nvim while still keeping
|
|||||||
it fast and lightweight for general use. It's also analogous to the |:helptags|
|
it fast and lightweight for general use. It's also analogous to the |:helptags|
|
||||||
command.
|
command.
|
||||||
|
|
||||||
Unless a path is set in the `$NVIM_RPLUGIN_MANIFEST` environment variable, the
|
*$NVIM_RPLUGIN_MANIFEST*
|
||||||
manifest will be written to a file named `rplugin.vim` in one of the following
|
Unless $NVIM_RPLUGIN_MANIFEST is set the manifest will be written to a file
|
||||||
directories:
|
named `rplugin.vim` at:
|
||||||
|
|
||||||
Unix ~
|
Unix ~
|
||||||
$XDG_DATA_HOME/nvim/ or ~/.local/share/nvim/
|
$XDG_DATA_HOME/nvim/ or ~/.local/share/nvim/
|
||||||
|
Loading…
Reference in New Issue
Block a user