Update :VimikiGenerateTags -- use tags as anchors in links

This commit is contained in:
Ivan Tishchenko 2015-01-10 17:10:18 +03:00
parent d72ef4dd70
commit b912e4e3c7

View File

@ -1997,7 +1997,7 @@ function! vimwiki#base#update_tags(full_rebuild) "{{{
endfunction " }}} endfunction " }}}
" vimwiki#base#scan_tags " vimwiki#base#scan_tags
" Scans the list (argument) and produces tags metadata dictionary. " Scans the list of text lines (argument) and produces tags metadata.
function! vimwiki#base#scan_tags(lines, page_name) "{{{ function! vimwiki#base#scan_tags(lines, page_name) "{{{
let metadata = [] let metadata = []
@ -2060,8 +2060,11 @@ function! vimwiki#base#scan_tags(lines, page_name) "{{{
let entry.lineno = line_nr let entry.lineno = line_nr
if line_nr <= (header_line_nr + PROXIMITY_LINES_NR) if line_nr <= (header_line_nr + PROXIMITY_LINES_NR)
let entry.link = page_name . '#' . current_complete_anchor let entry.link = page_name . '#' . current_complete_anchor
else elseif header_line_nr < 0
" Tag appeared before the first header
let entry.link = page_name let entry.link = page_name
else
let entry.link = page_name . '#' . tag
endif endif
call add(metadata, entry) call add(metadata, entry)
endwhile endwhile