From c40c252b69b44b55e4df2536fd03fa5372411c42 Mon Sep 17 00:00:00 2001 From: Ches Martin Date: Sun, 8 Feb 2015 04:04:07 +0700 Subject: [PATCH] Use handlers with Dispatch, not plain copen Otherwise e.g. when you have vertical splits open, the quickfix list will not span the full bottom of the Vim window like standard ack.vim behavior. Also broke location list entirely... --- autoload/ack.vim | 2 +- plugin/ack.vim | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/autoload/ack.vim b/autoload/ack.vim index fae73b1f..94b32acb 100644 --- a/autoload/ack.vim +++ b/autoload/ack.vim @@ -53,7 +53,7 @@ function! ack#Ack(cmd, args) if !g:ack_use_dispatch call ack#show_results() else - copen + execute s:handler endif call apply_maps() call highlight(l:grepargs) diff --git a/plugin/ack.vim b/plugin/ack.vim index 6d6c55bc..846ecfa9 100644 --- a/plugin/ack.vim +++ b/plugin/ack.vim @@ -22,7 +22,13 @@ if !exists("g:ack_apply_lmappings") let g:ack_apply_lmappings = !exists("g:ack_lhandler") endif -if !exists("g:ack_use_dispatch") +if exists("g:ack_use_dispatch") + if g:ack_use_dispatch && !exists(":Dispatch") + let msg = "Ack: Dispatch not loaded! Falling back to g:ack_use_dispatch = 0." + echohl WarningMsg | echom msg | echohl None + let g:ack_use_dispatch = 0 + endif +else let g:ack_use_dispatch = 0 end