Make Ggrep to work properly on Mac

- Color were causing to appear strange characters in the result.
- These characters made impossible to navigate the results
- The solution was to disable colors while executing git grep
This commit is contained in:
Diego Vera
2015-05-16 14:27:44 +02:00
committed by Tim Pope
parent 4cc201cbe3
commit b0e38f08dc

View File

@@ -1239,7 +1239,7 @@ function! s:Grep(cmd,bang,arg) abort
let dir = getcwd() let dir = getcwd()
try try
execute cd.'`=s:repo().tree()`' execute cd.'`=s:repo().tree()`'
let &grepprg = s:repo().git_command('--no-pager', 'grep', '-n') let &grepprg = s:repo().git_command('--no-pager', 'grep', '-n', '--no-color')
let &grepformat = '%f:%l:%m' let &grepformat = '%f:%l:%m'
exe a:cmd.'! '.escape(matchstr(a:arg,'\v\C.{-}%($|[''" ]\@=\|)@='),'|') exe a:cmd.'! '.escape(matchstr(a:arg,'\v\C.{-}%($|[''" ]\@=\|)@='),'|')
let list = a:cmd =~# '^l' ? getloclist(0) : getqflist() let list = a:cmd =~# '^l' ? getloclist(0) : getqflist()