From ddc67fc13624dbec62121e0c55ae03f270f66241 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Sun, 24 Sep 2017 23:59:28 +0900 Subject: [PATCH] Fix helptags generation for plugins with custom rtp Close #684 --- plug.vim | 2 +- test/run | 4 ++++ test/workflow.vader | 11 +++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/plug.vim b/plug.vim index c3a515e..d720e2f 100644 --- a/plug.vim +++ b/plug.vim @@ -605,7 +605,7 @@ function! plug#helptags() return s:err('plug#begin was not called') endif for spec in values(g:plugs) - let docd = join([spec.dir, 'doc'], '/') + let docd = join([s:rtp(spec), 'doc'], '/') if isdirectory(docd) silent! execute 'helptags' s:esc(docd) endif diff --git a/test/run b/test/run index 133859c..6e19ed8 100755 --- a/test/run +++ b/test/run @@ -77,6 +77,10 @@ DOC make_dirs yyy/ yyy make_dirs yyy/after yyy + mkdir -p "$PLUG_FIXTURES/yyy/rtp/doc" + cat > "$PLUG_FIXTURES/yyy/rtp/doc/yyy.txt" << DOC +hello *yyy* +DOC gitinit yyy make_dirs z1/ z1 diff --git a/test/workflow.vader b/test/workflow.vader index 29826da..8034d2f 100644 --- a/test/workflow.vader +++ b/test/workflow.vader @@ -1130,10 +1130,17 @@ Before: ********************************************************************** Execute (plug#helptags): + call plug#begin() + Plug '$PLUG_FIXTURES/xxx' + Plug '$PLUG_FIXTURES/yyy', { 'rtp': 'rtp' } + call plug#end() silent! call delete(expand('$PLUG_FIXTURES/xxx/doc/tags')) + silent! call delete(expand('$PLUG_FIXTURES/yyy/rtp/doc/tags')) Assert !filereadable(expand('$PLUG_FIXTURES/xxx/doc/tags')) + Assert !filereadable(expand('$PLUG_FIXTURES/yyy/rtp/doc/tags')) AssertEqual 1, plug#helptags() Assert filereadable(expand('$PLUG_FIXTURES/xxx/doc/tags')) + Assert filereadable(expand('$PLUG_FIXTURES/yyy/rtp/doc/tags')) ********************************************************************** ~ Manual loading @@ -1141,6 +1148,10 @@ Execute (plug#helptags): Execute (plug#load - invalid arguments): call ResetPlug() + call plug#begin() + Plug '$PLUG_FIXTURES/xxx', { 'for': 'xxx' } + Plug '$PLUG_FIXTURES/yyy', { 'for': 'yyy' } + call plug#end() AssertEqual 0, plug#load() AssertEqual 0, plug#load('non-existent-plugin') AssertEqual 0, plug#load('non-existent-plugin', 'another-non-existent-plugin')