From bad9b1228bbb41c446f48f9c38c276bbca0791c0 Mon Sep 17 00:00:00 2001 From: Samuel Hym Date: Sat, 26 May 2018 14:53:44 +0200 Subject: [PATCH] Skip automatic copen when height <= 0 copen and cwindow expect a positive number for the window height so we can use the value 0 to state that the quickfix window should not be opened or closed automatically So when setting g:dispatch_quickfix_height to 0, `:Copen` updates the quickfix list without opening the quickfix window and prevents the quickfix window from opening on completion of a `:Dispatch` until the next explicit `:copen` --- autoload/dispatch.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/dispatch.vim b/autoload/dispatch.vim index c3eaf5e..4ac9fff 100644 --- a/autoload/dispatch.vim +++ b/autoload/dispatch.vim @@ -1091,6 +1091,9 @@ endfunction function! s:cwindow(request, all, copen) abort call s:cgetfile(a:request, a:all) let height = get(g:, 'dispatch_quickfix_height', 10) + if height <= 0 + return + endif let was_qf = s:is_quickfix() execute 'botright' (a:copen ? 'copen' : 'cwindow') height if !was_qf && s:is_quickfix() && a:copen !=# -2