Skip to content

Commit 2d07f31

Browse files
committed
Add a count to Copen to set quickfix height
1 parent 14a1695 commit 2d07f31

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

autoload/dispatch.vim

+6-1
Original file line numberDiff line numberDiff line change
@@ -842,7 +842,12 @@ endfunction
842842
" }}}1
843843
" Quickfix window {{{1
844844

845-
function! dispatch#copen(bang) abort
845+
function! dispatch#copen(bang, count) abort
846+
if a:count != 0
847+
let g:dispatch_quickfix_height = a:count
848+
elseif has_key(g:, 'dispatch_quickfix_height')
849+
unlet g:dispatch_quickfix_height
850+
endif
846851
if empty(s:makes)
847852
return 'echoerr ' . string('No dispatches yet')
848853
endif

plugin/dispatch.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ command! -bang -nargs=* -complete=customlist,dispatch#command_complete Spawn
2525
command! -bang -nargs=* -complete=customlist,dispatch#command_complete Start
2626
\ execute dispatch#start_command(<bang>0, <q-args>)
2727

28-
command! -bang -bar Copen call dispatch#copen(<bang>0)
28+
command! -bang -count -bar Copen call dispatch#copen(<bang>0, <count>)
2929

3030
function! DispatchComplete(id) abort
3131
return dispatch#complete(a:id)

0 commit comments

Comments
 (0)