diff --git a/autoload/vimwiki/html.vim b/autoload/vimwiki/html.vim index d9a5f81..fa7e36d 100644 --- a/autoload/vimwiki/html.vim +++ b/autoload/vimwiki/html.vim @@ -1328,11 +1328,6 @@ endfunction " }}} 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 done = 0 diff --git a/doc/vimwiki.txt b/doc/vimwiki.txt index 1c84df9..51896c1 100644 --- a/doc/vimwiki.txt +++ b/doc/vimwiki.txt @@ -1740,17 +1740,14 @@ This will keep your HTML files up to date. *vimwiki-option-auto_toc* ------------------------------------------------------------------------------ -Set this option to a value greater than 0 to automatically update the Table of -Contents: > +Key Default value Values~ +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}] -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* ------------------------------------------------------------------------------ diff --git a/ftplugin/vimwiki.vim b/ftplugin/vimwiki.vim index 27399fd..89d8be5 100644 --- a/ftplugin/vimwiki.vim +++ b/ftplugin/vimwiki.vim @@ -617,7 +617,7 @@ nnoremap VimwikiRemoveHeaderLevel : " AUTOCOMMANDS {{{ function! s:toc_html() - if VimwikiGet('auto_toc') >= 2 && VimwikiGet('auto_export') == 0 + if VimwikiGet('auto_toc') call vimwiki#base#table_of_contents(0) endif if VimwikiGet('auto_export') @@ -626,7 +626,7 @@ function! s:toc_html() endif endfunction -if VimwikiGet('auto_export') || VimwikiGet('auto_toc') >= 2 +if VimwikiGet('auto_export') || VimwikiGet('auto_toc') augroup vimwiki au BufWritePost call s:toc_html() augroup END