[Ag] Ignore error while opening the first file

This commit is contained in:
Junegunn Choi
2015-12-18 13:05:02 +09:00
parent e487084857
commit 47f2b5042f

View File

@@ -394,9 +394,12 @@ function! s:ag_handler(lines)
let list = map(a:lines[1:], 's:ag_to_qf(v:val)')
let first = list[0]
execute cmd s:escape(first.filename)
execute first.lnum
execute 'normal!' first.col.'|zz'
try
execute cmd s:escape(first.filename)
execute first.lnum
execute 'normal!' first.col.'|zz'
catch
endtry
if len(list) > 1
call setqflist(list)