Skip to content

Commit ddc67fc

Browse files
committed
Fix helptags generation for plugins with custom rtp
Close #684
1 parent cd44b03 commit ddc67fc

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

plug.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ function! plug#helptags()
605605
return s:err('plug#begin was not called')
606606
endif
607607
for spec in values(g:plugs)
608-
let docd = join([spec.dir, 'doc'], '/')
608+
let docd = join([s:rtp(spec), 'doc'], '/')
609609
if isdirectory(docd)
610610
silent! execute 'helptags' s:esc(docd)
611611
endif

test/run

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ DOC
7777

7878
make_dirs yyy/ yyy
7979
make_dirs yyy/after yyy
80+
mkdir -p "$PLUG_FIXTURES/yyy/rtp/doc"
81+
cat > "$PLUG_FIXTURES/yyy/rtp/doc/yyy.txt" << DOC
82+
hello *yyy*
83+
DOC
8084
gitinit yyy
8185

8286
make_dirs z1/ z1

test/workflow.vader

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1130,17 +1130,28 @@ Before:
11301130
**********************************************************************
11311131

11321132
Execute (plug#helptags):
1133+
call plug#begin()
1134+
Plug '$PLUG_FIXTURES/xxx'
1135+
Plug '$PLUG_FIXTURES/yyy', { 'rtp': 'rtp' }
1136+
call plug#end()
11331137
silent! call delete(expand('$PLUG_FIXTURES/xxx/doc/tags'))
1138+
silent! call delete(expand('$PLUG_FIXTURES/yyy/rtp/doc/tags'))
11341139
Assert !filereadable(expand('$PLUG_FIXTURES/xxx/doc/tags'))
1140+
Assert !filereadable(expand('$PLUG_FIXTURES/yyy/rtp/doc/tags'))
11351141
AssertEqual 1, plug#helptags()
11361142
Assert filereadable(expand('$PLUG_FIXTURES/xxx/doc/tags'))
1143+
Assert filereadable(expand('$PLUG_FIXTURES/yyy/rtp/doc/tags'))
11371144

11381145
**********************************************************************
11391146
~ Manual loading
11401147
**********************************************************************
11411148

11421149
Execute (plug#load - invalid arguments):
11431150
call ResetPlug()
1151+
call plug#begin()
1152+
Plug '$PLUG_FIXTURES/xxx', { 'for': 'xxx' }
1153+
Plug '$PLUG_FIXTURES/yyy', { 'for': 'yyy' }
1154+
call plug#end()
11441155
AssertEqual 0, plug#load()
11451156
AssertEqual 0, plug#load('non-existent-plugin')
11461157
AssertEqual 0, plug#load('non-existent-plugin', 'another-non-existent-plugin')

0 commit comments

Comments
 (0)