mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-10-04 19:28:53 +08:00
End an address fragment at a tab
On the :Tags path the rest of the line carries the extension fields, and an unterminated pattern took them into the search, so '/^foo' became '/^foo<Tab>f<Tab>file:' and found nothing. A helptags address, the case the fragment is for, holds no tab.
This commit is contained in:
1 file changed
+2
-2
@@ -561,7 +561,7 @@ endfunction
|
|||||||
" a fragment is the cut, and it would match some other line. Running to the end
|
" a fragment is the cut, and it would match some other line. Running to the end
|
||||||
" of the line it takes any '|' or ';' with it, so it cannot chain a command.
|
" of the line it takes any '|' or ';' with it, so it cannot chain a command.
|
||||||
let s:tag_address_part = '\%(\d\+\|/\%(\\.\|[^/\\]\)*/\|?\%(\\.\|[^?\\]\)*?\)'
|
let s:tag_address_part = '\%(\d\+\|/\%(\\.\|[^/\\]\)*/\|?\%(\\.\|[^?\\]\)*?\)'
|
||||||
let s:tag_address_open = '\%(/\%(\\.\|[^/\\]\)*\|?\%(\\.\|[^?\\]\)*\)'
|
let s:tag_address_open = '\%(/\%(\\.\|[^/\\\t]\)*\|?\%(\\.\|[^?\\\t]\)*\)'
|
||||||
function! s:tag_address(rest, whole)
|
function! s:tag_address(rest, whole)
|
||||||
" :BTags aligns its columns, so its field arrives padded, and a tags file with
|
" :BTags aligns its columns, so its field arrives padded, and a tags file with
|
||||||
" CRLF endings leaves a carriage return, which s:strip() keeps
|
" CRLF endings leaves a carriage return, which s:strip() keeps
|
||||||
@@ -575,7 +575,7 @@ function! s:tag_address(rest, whole)
|
|||||||
if !empty(address)
|
if !empty(address)
|
||||||
return address
|
return address
|
||||||
endif
|
endif
|
||||||
return a:whole ? matchstr(rest, '^'.s:tag_address_open.'$') : ''
|
return a:whole ? matchstr(rest, '^'.s:tag_address_open.'\ze\%(\t\|$\)') : ''
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" [key, [filename, [stay_on_edit: 0]]]
|
" [key, [filename, [stay_on_edit: 0]]]
|
||||||
|
|||||||
Reference in new issue
Block a user