mirror of
https://github.com/junegunn/vim-plug.git
synced 2024-12-24 13:07:36 -07:00
Add plug#helptags()
This commit is contained in:
parent
3a2e406cd0
commit
d0c94a9b08
8
plug.vim
8
plug.vim
@ -369,13 +369,17 @@ function! s:update(force, ...)
|
|||||||
call s:update_impl(1, a:force, a:000)
|
call s:update_impl(1, a:force, a:000)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:helptags()
|
function! plug#helptags()
|
||||||
|
if !exists('g:plugs')
|
||||||
|
return s:err('plug#begin is not called')
|
||||||
|
endif
|
||||||
for spec in values(g:plugs)
|
for spec in values(g:plugs)
|
||||||
let docd = join([spec.dir, 'doc'], '/')
|
let docd = join([spec.dir, 'doc'], '/')
|
||||||
if isdirectory(docd)
|
if isdirectory(docd)
|
||||||
silent! execute 'helptags '. s:esc(docd)
|
silent! execute 'helptags '. s:esc(docd)
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
return 1
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:syntax()
|
function! s:syntax()
|
||||||
@ -508,7 +512,7 @@ endfunction
|
|||||||
function! s:finish(pull)
|
function! s:finish(pull)
|
||||||
call append(3, '- Finishing ... ')
|
call append(3, '- Finishing ... ')
|
||||||
redraw
|
redraw
|
||||||
call s:helptags()
|
call plug#helptags()
|
||||||
call plug#end()
|
call plug#end()
|
||||||
call setline(4, getline(4) . 'Done!')
|
call setline(4, getline(4) . 'Done!')
|
||||||
normal! gg
|
normal! gg
|
||||||
|
4
test/run
4
test/run
@ -30,6 +30,10 @@ EOF
|
|||||||
|
|
||||||
make_dirs xxx/
|
make_dirs xxx/
|
||||||
make_dirs xxx/after
|
make_dirs xxx/after
|
||||||
|
mkdir xxx/doc
|
||||||
|
cat > xxx/doc/xxx.txt << DOC
|
||||||
|
hello *xxx*
|
||||||
|
DOC
|
||||||
|
|
||||||
cat > /tmp/mini-vimrc << VIMRC
|
cat > /tmp/mini-vimrc << VIMRC
|
||||||
set rtp+=vader.vim
|
set rtp+=vader.vim
|
||||||
|
@ -761,6 +761,16 @@ Execute (Filetype-based on-demand loading):
|
|||||||
setf xxx
|
setf xxx
|
||||||
AssertEqual ['/ftdetect', 'after/ftdetect', '/plugin', 'after/plugin', '/ftplugin', 'after/ftplugin', '/indent', 'after/indent', '/syntax', 'after/syntax'], g:xxx
|
AssertEqual ['/ftdetect', 'after/ftdetect', '/plugin', 'after/plugin', '/ftplugin', 'after/ftplugin', '/indent', 'after/indent', '/syntax', 'after/syntax'], g:xxx
|
||||||
|
|
||||||
|
**********************************************************************
|
||||||
|
~ plug#helptags()
|
||||||
|
**********************************************************************
|
||||||
|
|
||||||
|
Execute (plug#helptags):
|
||||||
|
silent! call delete(expand('$PWD/xxx/doc/tags'))
|
||||||
|
Assert !filereadable(expand('$PWD/xxx/doc/tags'))
|
||||||
|
AssertEqual 1, plug#helptags()
|
||||||
|
Assert filereadable(expand('$PWD/xxx/doc/tags'))
|
||||||
|
|
||||||
Before:
|
Before:
|
||||||
Execute (Cleanup):
|
Execute (Cleanup):
|
||||||
silent! call system('rm -rf '.temp_plugged)
|
silent! call system('rm -rf '.temp_plugged)
|
||||||
|
Loading…
Reference in New Issue
Block a user