A file tag must be at the very top of the file

Ref #85
This commit is contained in:
EinfachToll 2015-06-10 22:04:21 +02:00
parent b808dcfdc1
commit 7aa273fd7c

View File

@ -119,11 +119,11 @@ function! s:scan_tags(lines, page_name) "{{{
let entry = {} let entry = {}
let entry.tagname = tag let entry.tagname = tag
let entry.lineno = line_nr let entry.lineno = line_nr
if line_nr <= (header_line_nr + PROXIMITY_LINES_NR) if line_nr <= PROXIMITY_LINES_NR && header_line_nr < 0
let entry.link = page_name . '#' . current_complete_anchor " Tag appeared at the top of the file
elseif header_line_nr < 0
" Tag appeared before the first header
let entry.link = page_name let entry.link = page_name
elseif line_nr <= (header_line_nr + PROXIMITY_LINES_NR)
let entry.link = page_name . '#' . current_complete_anchor
else else
let entry.link = page_name . '#' . tag let entry.link = page_name . '#' . tag
endif endif