mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-09-30 23:52:24 +08:00
Search a tag address with case sensitivity
Builtin tag jumps clear 'ignorecase' along with setting 'nomagic' and 'wrapscan'. Without it, ':Tags' on '/^foo$/' stopped at a line holding 'FOO' with 'ignorecase' set, and wrote that line into the quickfix list. 'smartcase' only applies while 'ignorecase' is on, so it needs nothing.
This commit is contained in:
@@ -720,15 +720,15 @@ function! s:show_entry(winid, bufnr, dir, kind, entry) abort
|
||||
" 'acd' would move the cwd on the first open, and s:ag_to_qf resolves a
|
||||
" relative match against it. Tag addresses are searched with the settings
|
||||
" s:tags_sink uses.
|
||||
let [magic, wrapscan, acd] = [&magic, &wrapscan, &acd]
|
||||
let [magic, wrapscan, acd, ic] = [&magic, &wrapscan, &acd, &ignorecase]
|
||||
let &acd = 0
|
||||
if a:kind ==# 'tags' || a:kind ==# 'btags'
|
||||
let [&magic, &wrapscan] = [0, 1]
|
||||
let [&magic, &wrapscan, &ignorecase] = [0, 1, 0]
|
||||
endif
|
||||
try
|
||||
call s:goto_entry(a:winid, a:bufnr, a:dir, a:kind, entry)
|
||||
finally
|
||||
let [&magic, &wrapscan, &acd] = [magic, wrapscan, acd]
|
||||
let [&magic, &wrapscan, &acd, &ignorecase] = [magic, wrapscan, acd, ic]
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
@@ -1698,7 +1698,8 @@ function! s:btags_sink(from, lines)
|
||||
try
|
||||
" Searched with the settings s:tags_sink and the CTRL-O callback use, and a
|
||||
" failing address must not drop the rest of the selection
|
||||
let [magic, &magic, wrapscan, &wrapscan] = [&magic, 0, &wrapscan, 1]
|
||||
let [magic, &magic, wrapscan, &wrapscan, ic, &ignorecase] =
|
||||
\ [&magic, 0, &wrapscan, 1, &ignorecase, 0]
|
||||
for line in a:lines[1:]
|
||||
try
|
||||
let parts = split(line, "\t")
|
||||
@@ -1718,7 +1719,7 @@ function! s:btags_sink(from, lines)
|
||||
endtry
|
||||
endfor
|
||||
finally
|
||||
let [&magic, &wrapscan] = [magic, wrapscan]
|
||||
let [&magic, &wrapscan, &ignorecase] = [magic, wrapscan, ic]
|
||||
endtry
|
||||
|
||||
if len(qfl) > 1
|
||||
@@ -1780,7 +1781,8 @@ function! s:tags_sink(from, lines)
|
||||
let [key; list] = a:lines
|
||||
|
||||
try
|
||||
let [magic, &magic, wrapscan, &wrapscan, acd, &acd] = [&magic, 0, &wrapscan, 1, &acd, 0]
|
||||
let [magic, &magic, wrapscan, &wrapscan, acd, &acd, ic, &ignorecase] =
|
||||
\ [&magic, 0, &wrapscan, 1, &acd, 0, &ignorecase, 0]
|
||||
for line in list
|
||||
try
|
||||
let parts = split(line, '\t\zs')
|
||||
@@ -1809,7 +1811,7 @@ function! s:tags_sink(from, lines)
|
||||
endtry
|
||||
endfor
|
||||
finally
|
||||
let [&magic, &wrapscan, &acd] = [magic, wrapscan, acd]
|
||||
let [&magic, &wrapscan, &acd, &ignorecase] = [magic, wrapscan, acd, ic]
|
||||
endtry
|
||||
|
||||
if len(qfl) > 1
|
||||
|
||||
Reference in New Issue
Block a user