From 3c075654d424c6e3c20521bd4567b517a2410593 Mon Sep 17 00:00:00 2001 From: Jan Larres Date: Sun, 14 Aug 2011 18:11:54 +1200 Subject: [PATCH] Update line info when jumping to a tag, closes #26 --- autoload/tagbar.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/autoload/tagbar.vim b/autoload/tagbar.vim index 24ec962..794c3b2 100644 --- a/autoload/tagbar.vim +++ b/autoload/tagbar.vim @@ -2341,6 +2341,14 @@ function! s:JumpToTag(stay_in_tagbar) endwhile endif + " If the tag is on a different line after unsaved changes update the tag + " and file infos/objects + let curline = line('.') + if taginfo.fields.line != curline + let taginfo.fields.line = curline + let taginfo.fileinfo.fline[curline] = taginfo + endif + " Center the tag in the window normal! z.