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

Prevent search results from leaking into the terminal #63

Merged
Merged
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
14 changes: 10 additions & 4 deletions autoload/ag.vim
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,21 @@ function! ag#Ag(cmd, args)
let g:agformat="%f:%l:%c:%m"
endif

let grepprg_bak=&grepprg
let grepformat_bak=&grepformat
let l:grepprg_bak=&grepprg
let l:grepformat_bak=&grepformat
let l:t_ti_bak=&t_ti
let l:t_te_bak=&t_te
try
let &grepprg=g:agprg
let &grepformat=g:agformat
set t_ti=
set t_te=
silent execute a:cmd . " " . escape(l:grepargs, '|')
finally
let &grepprg=grepprg_bak
let &grepformat=grepformat_bak
let &grepprg=l:grepprg_bak
let &grepformat=l:grepformat_bak
let &t_ti=l:t_ti_bak
let &t_te=l:t_te_bak
endtry

if a:cmd =~# '^l'
Expand Down