From 14f808b543ac5ebc658d5566e1d02ff97f630a22 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Mon, 28 Sep 2026 05:33:53 +0900 Subject: [PATCH] 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 '/^fooffile:' and found nothing. A helptags address, the case the fragment is for, holds no tab. --- autoload/fzf/vim.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim index c52a05d..38d9650 100755 --- a/autoload/fzf/vim.vim +++ b/autoload/fzf/vim.vim @@ -561,7 +561,7 @@ endfunction " 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. let s:tag_address_part = '\%(\d\+\|/\%(\\.\|[^/\\]\)*/\|?\%(\\.\|[^?\\]\)*?\)' -let s:tag_address_open = '\%(/\%(\\.\|[^/\\]\)*\|?\%(\\.\|[^?\\]\)*\)' +let s:tag_address_open = '\%(/\%(\\.\|[^/\\\t]\)*\|?\%(\\.\|[^?\\\t]\)*\)' function! s:tag_address(rest, whole) " :BTags aligns its columns, so its field arrives padded, and a tags file with " CRLF endings leaves a carriage return, which s:strip() keeps @@ -575,7 +575,7 @@ function! s:tag_address(rest, whole) if !empty(address) return address endif - return a:whole ? matchstr(rest, '^'.s:tag_address_open.'$') : '' + return a:whole ? matchstr(rest, '^'.s:tag_address_open.'\ze\%(\t\|$\)') : '' endfunction " [key, [filename, [stay_on_edit: 0]]]