Skip to content

Commit 6f93109

Browse files
shymtpope
authored andcommitted
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`
1 parent 1ea256e commit 6f93109

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

autoload/dispatch.vim

+3
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,9 @@ endfunction
10911091
function! s:cwindow(request, all, copen) abort
10921092
call s:cgetfile(a:request, a:all)
10931093
let height = get(g:, 'dispatch_quickfix_height', 10)
1094+
if height <= 0
1095+
return
1096+
endif
10941097
let was_qf = s:is_quickfix()
10951098
execute 'botright' (a:copen ? 'copen' : 'cwindow') height
10961099
if !was_qf && s:is_quickfix() && a:copen !=# -2

0 commit comments

Comments
 (0)