From 552baf98b31c5f07eefdab5a67a20767c5b94547 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 13 Jan 2019 15:13:37 -0500 Subject: [PATCH] Support git grep --column Closes https://github.com/tpope/vim-fugitive/issues/1168 --- autoload/fugitive.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index a9a8d74..63fec0a 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -2794,7 +2794,10 @@ function! s:Grep(cmd,bang,arg) abort try let cdback = s:Cd(s:Tree()) let &grepprg = s:UserCommand() . ' --no-pager grep -n --no-color' - let &grepformat = '%f:%l:%m,%m %f match%ts,%f' + let &grepformat = '%f:%l:%c:%m,%f:%l:%m,%m %f match%ts,%f' + if fugitive#GitVersion(2, 19) + let &grepprg .= ' --column' + endif exe a:cmd.'! '.escape(s:ShellExpand(matchstr(a:arg, '\v\C.{-}%($|[''" ]\@=\|)@=')), '|#%') let list = a:cmd =~# '^l' ? getloclist(0) : getqflist() for entry in list