Skip to content

Commit

Permalink
Make the quickfix/locationlist handlers configurable.
Browse files Browse the repository at this point in the history
This allows people to do things like `let g:ack_qhandler='CtrlPQuickfix'`
and have the results handled by CtrlP's quickfix mode.
  • Loading branch information
Nate Soares authored and mileszs committed Nov 22, 2012
1 parent fd9632b commit b1e7727
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions plugin/ack.vim
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@ if !exists("g:ackprg")
let g:ackprg=s:ackcommand." -H --nocolor --nogroup --column"
endif

function! s:Ack(cmd, args, ...)
if !exists("g:ack_qhandler")
let g:ack_qhandler="botright copen"
endif

if !exists("g:ack_lhandler")
let g:ack_lhandler="botright lopen"
endif

function! s:Ack(cmd, args)
redraw
echo "Searching ..."

Expand Down Expand Up @@ -41,9 +49,9 @@ function! s:Ack(cmd, args, ...)
endtry

if a:cmd =~# '^l'
botright lopen
exe g:ack_lhandler
else
botright copen
exe g:ack_qhandler
endif

exec "nnoremap <silent> <buffer> q :ccl<CR>"
Expand Down

0 comments on commit b1e7727

Please sign in to comment.