mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-10-13 00:20:14 +08:00
Leave the cursor alone when no tag was opened
Refusing the address of a single selected tag leaves the quickfix list empty, and 'normal! ^zvzz' then moved the cursor in whatever buffer the user was in.
This commit is contained in:
1 file changed
+3
-2
@@ -547,6 +547,7 @@ function! s:sandboxed(cmd)
|
|||||||
return 'sandbox execute '.string(a:cmd)
|
return 'sandbox execute '.string(a:cmd)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
|
||||||
" Address of a tag, given the rest of the line after the file name, or, with
|
" Address of a tag, given the rest of the line after the file name, or, with
|
||||||
" 'whole' off, the address field alone as :BTags reads it. Only the forms a tags
|
" 'whole' off, the address field alone as :BTags reads it. Only the forms a tags
|
||||||
" file is meant to hold, a line number and a search pattern, chained with ';' for
|
" file is meant to hold, a line number and a search pattern, chained with ';' for
|
||||||
@@ -1735,7 +1736,7 @@ function! s:btags_sink(from, lines)
|
|||||||
normal! g`'
|
normal! g`'
|
||||||
" Because 'listproc' will use 'cfirst' to go to the first item in the list
|
" Because 'listproc' will use 'cfirst' to go to the first item in the list
|
||||||
call s:fill_quickfix('btags', qfl)
|
call s:fill_quickfix('btags', qfl)
|
||||||
else
|
elseif len(qfl) == 1
|
||||||
normal! zvzz
|
normal! zvzz
|
||||||
endif
|
endif
|
||||||
if !empty(tagname)
|
if !empty(tagname)
|
||||||
@@ -1835,7 +1836,7 @@ function! s:tags_sink(from, lines)
|
|||||||
call s:action_for(key, qfl[0].filename, 1)
|
call s:action_for(key, qfl[0].filename, 1)
|
||||||
|
|
||||||
call s:fill_quickfix('tags', qfl)
|
call s:fill_quickfix('tags', qfl)
|
||||||
else
|
elseif len(qfl) == 1
|
||||||
normal! ^zvzz
|
normal! ^zvzz
|
||||||
endif
|
endif
|
||||||
if !empty(tagname)
|
if !empty(tagname)
|
||||||
|
|||||||
Reference in new issue
Block a user