Skip to content

Commit

Permalink
Merge pull request #126 from Linuus/feature/vim-dispatch-compatibility
Browse files Browse the repository at this point in the history
Make Ack work with vim-dispatch
  • Loading branch information
kassio committed May 4, 2014
2 parents 6bafadd + aa8579c commit 1ef7727
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ foo' to search for #define foo. (From blueyed in issue #5.)
* Add g:ack_mapping
* Add g:ack_default_options
* Add a help toggle `?`(like NERDTree)
* Add compatibility with [vim-dispatch](https://github.com/tpope/vim-dispatch)
13 changes: 11 additions & 2 deletions autoload/ack.vim
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,14 @@ 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, '|#%')
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 +49,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 1ef7727

Please sign in to comment.