Skip to content

Commit

Permalink
Fix helptags generation for plugins with custom rtp
Browse files Browse the repository at this point in the history
  • Loading branch information
junegunn committed Sep 24, 2017
1 parent cd44b03 commit ddc67fc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion plug.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/run
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 11 additions & 0 deletions test/workflow.vader
Original file line number Diff line number Diff line change
Expand Up @@ -1130,17 +1130,28 @@ 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
**********************************************************************

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')
Expand Down

0 comments on commit ddc67fc

Please sign in to comment.