Skip to content

Commit

Permalink
Make Ack work with vim-dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Linuus committed May 3, 2014
1 parent 6bafadd commit 5504367
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions autoload/ack.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@ function! ack#Ack(cmd, args)
try
" NOTE: we escape special chars, but not everything using shellescape to
" allow for passing arguments etc
silent execute a:cmd . " " . escape(l:grepargs, '|#%')
" silent execute a:cmd . " " . escape(l:grepargs, '|#%')
if exists(":Dispatch")
setlocal errorformat=%f:%l:%c:%m
let &l:makeprg=g:ackprg." " . escape(l:grepargs, '|#%')
Make
else
silent execute a:cmd . " " . escape(l:grepargs, '|#%')
endif

finally
let &grepprg=grepprg_bak
let &grepformat=grepformat_bak
Expand All @@ -42,7 +50,9 @@ function! ack#Ack(cmd, args)
let s:close_cmd = ':cclose<CR>'
endif

call ack#show_results()
if !exists(":Dispatch")
call ack#show_results()
endif
call <SID>highlight(l:grepargs)

redraw!
Expand Down

0 comments on commit 5504367

Please sign in to comment.