[Tags] Interrupt handling

This commit is contained in:
Junegunn Choi
2016-09-24 22:41:44 +09:00
parent 93dbf1711e
commit 726d37a686

View File

@@ -627,19 +627,24 @@ function! s:tags_sink(lines)
normal! m' normal! m'
let qfl = [] let qfl = []
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] try
for line in a:lines[1:] let [magic, &magic, wrapscan, &wrapscan] = [&magic, 0, &wrapscan, 1]
try 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
catch call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')})
call s:warn(v:exception) catch /^Vim:Interrupt$/
endtry break
endfor catch
let [&magic, &wrapscan] = [magic, wrapscan] call s:warn(v:exception)
endtry
endfor
finally
let [&magic, &wrapscan] = [magic, wrapscan]
endtry
if len(qfl) > 1 if len(qfl) > 1
call setqflist(qfl) call setqflist(qfl)
copen copen