From 7ab251e52488ce2f7cde95e3f4c820495dee9cfc Mon Sep 17 00:00:00 2001 From: jez Date: Fri, 11 Mar 2011 14:55:40 -0500 Subject: [PATCH] More robust parsing of tag scope. For jsctags. --- plugin/taglist.vim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/taglist.vim b/plugin/taglist.vim index 90290a4..aa2435a 100644 --- a/plugin/taglist.vim +++ b/plugin/taglist.vim @@ -2783,13 +2783,15 @@ endfunction " Extract the tag scope from the tag text function! s:Tlist_Extract_Tag_Scope(tag_line) let start = match(a:tag_line, 'line\(no\)\?:') - let end = strridx(a:tag_line, "\t") + let end = stridx(a:tag_line, "\t", start) if end <= start return '' endif let tag_scope = strpart(a:tag_line, end + 1) - let tag_scope = strpart(tag_scope, stridx(tag_scope, ':') + 1) + let tag_scope_start = stridx(tag_scope, ':') + 1 + let tag_scope_end = stridx(tag_scope, "\t") + let tag_scope = strpart(tag_scope, tag_scope_start, tag_scope_end - tag_scope_start) return tag_scope endfunction