Skip to content

Commit

Permalink
Add a count to Copen to set quickfix height
Browse files Browse the repository at this point in the history
  • Loading branch information
shym committed Aug 1, 2017
1 parent 14a1695 commit 2d07f31
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion autoload/dispatch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugin/dispatch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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(<bang>0, <q-args>)

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

function! DispatchComplete(id) abort
return dispatch#complete(a:id)
Expand Down

0 comments on commit 2d07f31

Please sign in to comment.