From 2d07f31c3d442f82640f780c0996787eded92771 Mon Sep 17 00:00:00 2001 From: Samuel Hym Date: Tue, 1 Aug 2017 22:09:04 +0200 Subject: [PATCH] Add a count to Copen to set quickfix height --- autoload/dispatch.vim | 7 ++++++- plugin/dispatch.vim | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/autoload/dispatch.vim b/autoload/dispatch.vim index 1d8755f..cd524a7 100644 --- a/autoload/dispatch.vim +++ b/autoload/dispatch.vim @@ -842,7 +842,12 @@ endfunction " }}}1 " Quickfix window {{{1 -function! dispatch#copen(bang) abort +function! dispatch#copen(bang, count) abort + if a:count != 0 + let g:dispatch_quickfix_height = a:count + elseif has_key(g:, 'dispatch_quickfix_height') + unlet g:dispatch_quickfix_height + endif if empty(s:makes) return 'echoerr ' . string('No dispatches yet') endif diff --git a/plugin/dispatch.vim b/plugin/dispatch.vim index 93488c7..2d8a518 100644 --- a/plugin/dispatch.vim +++ b/plugin/dispatch.vim @@ -25,7 +25,7 @@ command! -bang -nargs=* -complete=customlist,dispatch#command_complete Spawn command! -bang -nargs=* -complete=customlist,dispatch#command_complete Start \ execute dispatch#start_command(0, ) -command! -bang -bar Copen call dispatch#copen(0) +command! -bang -count -bar Copen call dispatch#copen(0, ) function! DispatchComplete(id) abort return dispatch#complete(a:id)