mirror of
https://github.com/junegunn/fzf.vim.git
synced 2026-02-21 00:58:35 +08:00
[Tags] Handle errors so that &magic and &wrapscan are properly restored
Close #202
This commit is contained in:
@@ -629,11 +629,15 @@ function! s:tags_sink(lines)
|
|||||||
let cmd = get(get(g:, 'fzf_action', s:default_action), a:lines[0], 'e')
|
let cmd = get(get(g:, 'fzf_action', s:default_action), a:lines[0], 'e')
|
||||||
let [magic, &magic, wrapscan, &wrapscan] = [&magic, 0, &wrapscan, 1]
|
let [magic, &magic, wrapscan, &wrapscan] = [&magic, 0, &wrapscan, 1]
|
||||||
for line in a:lines[1:]
|
for line in a:lines[1:]
|
||||||
let parts = split(line, '\t\zs')
|
try
|
||||||
let excmd = matchstr(join(parts[2:], ''), '^.*\ze;"\t')
|
let parts = split(line, '\t\zs')
|
||||||
call s:open(cmd, parts[1][:-2])
|
let excmd = matchstr(join(parts[2:], ''), '^.*\ze;"\t')
|
||||||
execute excmd
|
call s:open(cmd, parts[1][:-2])
|
||||||
call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')})
|
execute excmd
|
||||||
|
call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')})
|
||||||
|
catch
|
||||||
|
call s:warn(v:exception)
|
||||||
|
endtry
|
||||||
endfor
|
endfor
|
||||||
let [&magic, &wrapscan] = [magic, wrapscan]
|
let [&magic, &wrapscan] = [magic, wrapscan]
|
||||||
if len(qfl) > 1
|
if len(qfl) > 1
|
||||||
|
|||||||
Reference in New Issue
Block a user