From 7aa273fd7c3e0cec792ddb6f45a232115c791de1 Mon Sep 17 00:00:00 2001 From: EinfachToll Date: Wed, 10 Jun 2015 22:04:21 +0200 Subject: [PATCH] A file tag must be at the very top of the file Ref #85 --- autoload/vimwiki/tags.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autoload/vimwiki/tags.vim b/autoload/vimwiki/tags.vim index aa2cb0f..1191673 100644 --- a/autoload/vimwiki/tags.vim +++ b/autoload/vimwiki/tags.vim @@ -119,11 +119,11 @@ function! s:scan_tags(lines, page_name) "{{{ let entry = {} let entry.tagname = tag let entry.lineno = line_nr - if line_nr <= (header_line_nr + PROXIMITY_LINES_NR) - let entry.link = page_name . '#' . current_complete_anchor - elseif header_line_nr < 0 - " Tag appeared before the first header + if line_nr <= PROXIMITY_LINES_NR && header_line_nr < 0 + " Tag appeared at the top of the file let entry.link = page_name + elseif line_nr <= (header_line_nr + PROXIMITY_LINES_NR) + let entry.link = page_name . '#' . current_complete_anchor else let entry.link = page_name . '#' . tag endif