mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-09-30 07:32:23 +08:00
Take the carriage return off a tag address
A tags file with CRLF endings and no ';"' terminator, as 'ctags --format=1' writes on Windows, left a stray CR on the address, and s:strip() counts only spaces and tabs. Every entry in such a file was refused.
This commit is contained in:
@@ -563,8 +563,9 @@ endfunction
|
||||
let s:tag_address_part = '\%(\d\+\|/\%(\\.\|[^/\\]\)*/\|?\%(\\.\|[^?\\]\)*?\)'
|
||||
let s:tag_address_open = '\%(/\%(\\.\|[^/\\]\)*\|?\%(\\.\|[^?\\]\)*\)'
|
||||
function! s:tag_address(rest, whole)
|
||||
" :BTags aligns its columns, so its field arrives padded
|
||||
let rest = s:strip(a:rest)
|
||||
" :BTags aligns its columns, so its field arrives padded, and a tags file with
|
||||
" CRLF endings leaves a carriage return, which s:strip() keeps
|
||||
let rest = substitute(a:rest, '^[ \t\r]*\|[ \t\r]*$', '', 'g')
|
||||
let chain = '^'.s:tag_address_part.'\%(;'.s:tag_address_part.'\)*'
|
||||
let address = matchstr(rest, chain.'\ze\%(;"\|$\)')
|
||||
if !empty(address)
|
||||
|
||||
Reference in New Issue
Block a user