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 | |
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.
-rw-r--r-- | runtime/autoload/remote/host.vim | 26 | ||||
-rw-r--r-- | runtime/doc/remote_plugin.txt | 6 |
2 files changed, 13 insertions, 19 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 diff --git a/runtime/doc/remote_plugin.txt b/runtime/doc/remote_plugin.txt index 25fd638b10..dddc021d68 100644 --- a/runtime/doc/remote_plugin.txt +++ b/runtime/doc/remote_plugin.txt @@ -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/ |