Remove option 2 of 'auto_toc'

It doesn't really work for :VimwikiAll2HTML
This commit is contained in:
EinfachToll 2014-08-18 09:35:52 +02:00
parent 502212b58d
commit 2dd9a153bc
3 changed files with 8 additions and 16 deletions

View File

@ -1328,11 +1328,6 @@ endfunction " }}}
function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{ function! vimwiki#html#Wiki2HTML(path_html, wikifile) "{{{
if VimwikiGet('auto_toc') >= 1
call vimwiki#base#table_of_contents(0)
noautocmd update
endif
let starttime = reltime() " start the clock let starttime = reltime() " start the clock
let done = 0 let done = 0

View File

@ -1740,17 +1740,14 @@ This will keep your HTML files up to date.
*vimwiki-option-auto_toc* *vimwiki-option-auto_toc*
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Set this option to a value greater than 0 to automatically update the Table of Key Default value Values~
Contents: > auto_toc 0 0, 1
Description~
Set this option to 1 to automatically generate the table of contents when the
current wiki page is saved: >
let g:vimwiki_list = [{'path': '~/my_site/', 'auto_toc': 1}] let g:vimwiki_list = [{'path': '~/my_site/', 'auto_toc': 1}]
Value Description~
0 Don't update it automatically.
1 Update when the wiki file is converted to HTML.
2 Update when the wiki file is saved.
Default: 0
*vimwiki-option-index* *vimwiki-option-index*
------------------------------------------------------------------------------ ------------------------------------------------------------------------------

View File

@ -617,7 +617,7 @@ nnoremap <silent><buffer> <Plug>VimwikiRemoveHeaderLevel :
" AUTOCOMMANDS {{{ " AUTOCOMMANDS {{{
function! s:toc_html() function! s:toc_html()
if VimwikiGet('auto_toc') >= 2 && VimwikiGet('auto_export') == 0 if VimwikiGet('auto_toc')
call vimwiki#base#table_of_contents(0) call vimwiki#base#table_of_contents(0)
endif endif
if VimwikiGet('auto_export') if VimwikiGet('auto_export')
@ -626,7 +626,7 @@ function! s:toc_html()
endif endif
endfunction endfunction
if VimwikiGet('auto_export') || VimwikiGet('auto_toc') >= 2 if VimwikiGet('auto_export') || VimwikiGet('auto_toc')
augroup vimwiki augroup vimwiki
au BufWritePost <buffer> call s:toc_html() au BufWritePost <buffer> call s:toc_html()
augroup END augroup END