mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-10-04 19:28:53 +08:00
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:
1 file changed
+4
-3
@@ -1684,6 +1684,7 @@ function! s:btags_sink(from, lines)
|
|||||||
let parts = split(line, "\t")
|
let parts = split(line, "\t")
|
||||||
let excmd = s:tag_address(parts[2])
|
let excmd = s:tag_address(parts[2])
|
||||||
if empty(excmd)
|
if empty(excmd)
|
||||||
|
call s:warn('Unsupported tag address: '.s:strip(parts[0]))
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
call s:execute_tag_address(excmd)
|
call s:execute_tag_address(excmd)
|
||||||
@@ -1757,6 +1758,9 @@ function! s:tags_sink(from, lines)
|
|||||||
try
|
try
|
||||||
let parts = split(line, '\t\zs')
|
let parts = split(line, '\t\zs')
|
||||||
let excmd = s:tag_address(join(parts[2:-2], '')[:-2])
|
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 base = fnamemodify(parts[-1], ':h')
|
||||||
let relpath = parts[1][:-2]
|
let relpath = parts[1][:-2]
|
||||||
let abspath = relpath =~ (s:is_win ? '^[A-Z]:\' : '^/') ? relpath : join([base, relpath], '/')
|
let abspath = relpath =~ (s:is_win ? '^[A-Z]:\' : '^/') ? relpath : join([base, relpath], '/')
|
||||||
@@ -1766,9 +1770,6 @@ function! s:tags_sink(from, lines)
|
|||||||
else
|
else
|
||||||
call s:open(expand(abspath, 1))
|
call s:open(expand(abspath, 1))
|
||||||
endif
|
endif
|
||||||
if empty(excmd)
|
|
||||||
continue
|
|
||||||
endif
|
|
||||||
call s:execute_tag_address(excmd)
|
call s:execute_tag_address(excmd)
|
||||||
call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')})
|
call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')})
|
||||||
if empty(tagname)
|
if empty(tagname)
|
||||||
|
|||||||
Reference in new issue
Block a user