Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Fix" outputting to terminal every search! #278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions autoload/ack.vim
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,33 @@ endfunction "}}}
function! s:SearchWithGrep(grepcmd, grepprg, grepargs, grepformat) "{{{
let l:grepprg_bak = &l:grepprg
let l:grepformat_bak = &grepformat
if (&shell =~ '\v(bash|zsh)$')
let l:saved_shellpipe = &shellpipe
else
let l:t_te = &t_te
let l:t_ti = &t_ti
endif

try
let &l:grepprg = a:grepprg
let &grepformat = a:grepformat
if (&shell =~ '\v(bash|zsh)$')
let &shellpipe = '>'
else
let t_ti = ''
let t_te = ''
endif

silent execute a:grepcmd a:grepargs
finally
let &l:grepprg = l:grepprg_bak
let &grepformat = l:grepformat_bak
if (&shell =~ '\v(bash|zsh)$')
let &shellpipe = l:saved_shellpipe
else
let &t_te = l:t_te
let &t_ti = l:t_ti
endif
endtry
endfunction "}}}

Expand Down