Fix helptags generation for plugins with custom rtp

Close #684
This commit is contained in:
Junegunn Choi 2017-09-24 23:59:28 +09:00
parent cd44b03db2
commit ddc67fc136
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
3 changed files with 16 additions and 1 deletions

View File

@ -605,7 +605,7 @@ function! plug#helptags()
return s:err('plug#begin was not called') return s:err('plug#begin was not called')
endif endif
for spec in values(g:plugs) for spec in values(g:plugs)
let docd = join([spec.dir, 'doc'], '/') let docd = join([s:rtp(spec), 'doc'], '/')
if isdirectory(docd) if isdirectory(docd)
silent! execute 'helptags' s:esc(docd) silent! execute 'helptags' s:esc(docd)
endif endif

View File

@ -77,6 +77,10 @@ DOC
make_dirs yyy/ yyy make_dirs yyy/ yyy
make_dirs yyy/after 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 gitinit yyy
make_dirs z1/ z1 make_dirs z1/ z1

View File

@ -1130,10 +1130,17 @@ Before:
********************************************************************** **********************************************************************
Execute (plug#helptags): 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/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/xxx/doc/tags'))
Assert !filereadable(expand('$PLUG_FIXTURES/yyy/rtp/doc/tags'))
AssertEqual 1, plug#helptags() AssertEqual 1, plug#helptags()
Assert filereadable(expand('$PLUG_FIXTURES/xxx/doc/tags')) Assert filereadable(expand('$PLUG_FIXTURES/xxx/doc/tags'))
Assert filereadable(expand('$PLUG_FIXTURES/yyy/rtp/doc/tags'))
********************************************************************** **********************************************************************
~ Manual loading ~ Manual loading
@ -1141,6 +1148,10 @@ Execute (plug#helptags):
Execute (plug#load - invalid arguments): Execute (plug#load - invalid arguments):
call ResetPlug() 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()
AssertEqual 0, plug#load('non-existent-plugin') AssertEqual 0, plug#load('non-existent-plugin')
AssertEqual 0, plug#load('non-existent-plugin', 'another-non-existent-plugin') AssertEqual 0, plug#load('non-existent-plugin', 'another-non-existent-plugin')