mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Never jump to invalid entry after quickfix command
In particular, if the first :Ggrep result is a binary file, skip over it. I'm also leaning strongly towards not filling in the filename field at all for binary files, but I'll address that separately.
This commit is contained in:
@@ -1576,11 +1576,15 @@ function! s:QuickfixStream(nr, event, title, cmd, first, mods, callback, ...) ab
|
||||
call s:QuickfixSet(a:nr, buffer, 'a')
|
||||
|
||||
exe s:DoAutocmd('QuickFixCmdPost ' . event)
|
||||
if a:first && len(s:QuickfixGet(a:nr))
|
||||
return (a:nr < 0 ? 'cfirst' : 'lfirst')
|
||||
else
|
||||
return 'exe'
|
||||
if a:first
|
||||
let list = s:QuickfixGet(a:nr)
|
||||
for index in range(len(list))
|
||||
if list[index].valid
|
||||
return (index+1) . (a:nr < 0 ? 'cfirst' : 'lfirst')
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
return 'exe'
|
||||
endfunction
|
||||
|
||||
function! fugitive#Cwindow() abort
|
||||
|
||||
Reference in New Issue
Block a user