Refuse a tag entry before opening its file

A refused address left the buffer on that entry's file while contributing no
quickfix item, so a multi-selection lost its valid matches. Name the refused
tag as well, since nothing happens otherwise.
This commit is contained in:
Junegunn Choi
2026-09-27 23:47:01 +09:00
parent 9705771895
commit a4979fdcd4
+4 -3
View File
@@ -1684,6 +1684,7 @@ function! s:btags_sink(from, lines)
let parts = split(line, "\t")
let excmd = s:tag_address(parts[2])
if empty(excmd)
call s:warn('Unsupported tag address: '.s:strip(parts[0]))
continue
endif
call s:execute_tag_address(excmd)
@@ -1757,6 +1758,9 @@ function! s:tags_sink(from, lines)
try
let parts = split(line, '\t\zs')
let excmd = s:tag_address(join(parts[2:-2], '')[:-2])
if empty(excmd)
throw 'Unsupported tag address: '.s:strip(parts[0])
endif
let base = fnamemodify(parts[-1], ':h')
let relpath = parts[1][:-2]
let abspath = relpath =~ (s:is_win ? '^[A-Z]:\' : '^/') ? relpath : join([base, relpath], '/')
@@ -1766,9 +1770,6 @@ function! s:tags_sink(from, lines)
else
call s:open(expand(abspath, 1))
endif
if empty(excmd)
continue
endif
call s:execute_tag_address(excmd)
call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')})
if empty(tagname)