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:
Justin M. Keyes 2016-08-17 17:30:17 -04:00
parent 966f1abd8b
commit 4b0b391f9f
2 changed files with 13 additions and 19 deletions

View File

@ -126,13 +126,9 @@ function! s:GetManifestPath() abort
return fnamemodify($NVIM_RPLUGIN_MANIFEST, ':p')
endif
let preferred = has('win32')
\ ? ['$LOCALAPPDATA', '~/AppData/Local']
\ : ['$XDG_DATA_HOME', '~/.local/share']
for dest in preferred
if dest[0] == '$' && !exists(dest)
continue
let dest = has('win32') ? '$LOCALAPPDATA' : '$XDG_DATA_HOME'
if !exists(dest)
let dest = has('win32') ? '~/AppData/Local' : '~/.local/share'
endif
let dest = fnamemodify(expand(dest), ':p')
@ -140,9 +136,7 @@ function! s:GetManifestPath() abort
let dest .= 'nvim/'
call mkdir(dest, 'p', 700)
let manifest_base = dest
break
endif
endfor
return manifest_base.'rplugin.vim'
endfunction

View File

@ -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|
command.
Unless a path is set in the `$NVIM_RPLUGIN_MANIFEST` environment variable, the
manifest will be written to a file named `rplugin.vim` in one of the following
directories:
*$NVIM_RPLUGIN_MANIFEST*
Unless $NVIM_RPLUGIN_MANIFEST is set the manifest will be written to a file
named `rplugin.vim` at:
Unix ~
$XDG_DATA_HOME/nvim/ or ~/.local/share/nvim/