1
0
mirror of https://github.com/gryf/tagbar.git synced 2025-12-17 11:30:28 +01:00

Fix issue where --regex based file types can output duplicate lines when --sort=no (#471)

Fix issue where --regex based filetypes can output duplicate lines when --sort=no

Co-authored-by: Flemming Madsen <flemming@themadsens.dk>
This commit is contained in:
Flemming Madsen
2019-10-21 15:19:45 +02:00
committed by Caleb Maclennan
parent 23f148225b
commit a0526a6d5a

View File

@@ -1025,11 +1025,13 @@ function! s:ProcessFile(fname, ftype) abort
" Parse the ctags output lines
call tagbar#debug#log('Parsing ctags output')
let rawtaglist = split(ctags_output, '\n\+')
let seen = {}
for line in rawtaglist
" skip comments
if line =~# '^!_TAG_'
" skip comments and duplicates (can happen when --sort=no)
if line =~# '^!_TAG_' || has_key(seen, line)
continue
endif
let seen[line] = 1
let parts = split(line, ';"')
if len(parts) == 2 " Is a valid tag line
@@ -1259,7 +1261,7 @@ function! s:ParseTagline(part1, part2, typeinfo, fileinfo) abort
endfunction
" s:ProcessTag() {{{2
function s:ProcessTag(name, filename, pattern, fields, is_split, typeinfo, fileinfo) abort
function! s:ProcessTag(name, filename, pattern, fields, is_split, typeinfo, fileinfo) abort
if a:is_split
let taginfo = tagbar#prototypes#splittag#new(a:name)
else