diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2016-08-17 17:30:17 -0400 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-08-17 17:43:26 -0400 |
commit | 4b0b391f9f4ecac903b490cdb0834a2f4ab0e310 (patch) | |
tree | 744786bd703d35c794c2c03b7183bdf6125bf88a /runtime/autoload/remote/host.vim | |
parent | 966f1abd8bc07915c30b4530627e272bf7a1c1c6 (diff) | |
download | rneovim-4b0b391f9f4ecac903b490cdb0834a2f4ab0e310.tar.gz rneovim-4b0b391f9f4ecac903b490cdb0834a2f4ab0e310.tar.bz2 rneovim-4b0b391f9f4ecac903b490cdb0834a2f4ab0e310.zip |
host.vim: s:GetManifestPath(): Remove for-loop.
Without the for-loop it is easier to follow, more explicit, and fewer
lines.
Diffstat (limited to 'runtime/autoload/remote/host.vim')
-rw-r--r-- | runtime/autoload/remote/host.vim | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/runtime/autoload/remote/host.vim b/runtime/autoload/remote/host.vim index 104a27f357..355ff339dc 100644 --- a/runtime/autoload/remote/host.vim +++ b/runtime/autoload/remote/host.vim @@ -126,23 +126,17 @@ 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 - endif + 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') - if !empty(dest) && isdirectory(dest) - let dest .= 'nvim/' - call mkdir(dest, 'p', 700) - let manifest_base = dest - break - endif - endfor + let dest = fnamemodify(expand(dest), ':p') + if !empty(dest) && isdirectory(dest) + let dest .= 'nvim/' + call mkdir(dest, 'p', 700) + let manifest_base = dest + endif return manifest_base.'rplugin.vim' endfunction |