[Tags] Interrupt handling

This commit is contained in:
Junegunn Choi
2016-09-24 22:41:44 +09:00
parent 93dbf1711e
commit 726d37a686
+5
View File
@@ -627,6 +627,7 @@ 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')
try
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:]
try try
@@ -635,11 +636,15 @@ function! s:tags_sink(lines)
call s:open(cmd, parts[1][:-2]) call s:open(cmd, parts[1][:-2])
execute excmd execute excmd
call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')}) call add(qfl, {'filename': expand('%'), 'lnum': line('.'), 'text': getline('.')})
catch /^Vim:Interrupt$/
break
catch catch
call s:warn(v:exception) call s:warn(v:exception)
endtry endtry
endfor endfor
finally
let [&magic, &wrapscan] = [magic, wrapscan] let [&magic, &wrapscan] = [magic, wrapscan]
endtry
if len(qfl) > 1 if len(qfl) > 1
call setqflist(qfl) call setqflist(qfl)
copen copen