mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-09-30 07:32:23 +08:00
Rewrite the tabs of an address only where it ends in ';"'
Without the terminator nothing says which tab belongs to the pattern and which separates a column, so a tag command that adds columns without one had its address merged with them and refused.
This commit is contained in:
@@ -1655,9 +1655,11 @@ endfunction
|
||||
" ------------------------------------------------------------------
|
||||
" ctags leaves a tab inside a pattern as it found it, and splitting the line on
|
||||
" tabs would cut the address short, leaving a fragment that matches some other
|
||||
" line. '\t' matches the same text and keeps the field the line's third
|
||||
" line. '\t' matches the same text and keeps the field the line's third. Only the
|
||||
" ';"' terminator says where the address ends, so a line without one is left as
|
||||
" it is rather than guessed at
|
||||
function! s:tabs_in_address(line)
|
||||
return substitute(a:line, '^\%([^\t]*\t\)\{2}\zs.\{-}\ze\%(;"\t\|$\)',
|
||||
return substitute(a:line, '^\%([^\t]*\t\)\{2}\zs.\{-}\ze;"\t',
|
||||
\ '\=substitute(submatch(0), "\t", ''\\t'', "g")', '')
|
||||
endfunction
|
||||
|
||||
|
||||
Reference in New Issue
Block a user