Skip to content

Commit 2688733

Browse files
committed
Fix window focus after failed :Dispatch
1 parent d5da31c commit 2688733

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

autoload/dispatch.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,7 +818,7 @@ function! dispatch#complete(file) abort
818818
endif
819819
echo label '!'.request.expanded s:postfix(request)
820820
if !request.background
821-
call s:cgetfile(request, 0, -status)
821+
call s:cgetfile(request, 0, status)
822822
redraw
823823
endif
824824
endif
@@ -836,7 +836,7 @@ function! dispatch#copen(bang) abort
836836
if !dispatch#completed(request) && filereadable(request.file . '.complete')
837837
let request.completed = 1
838838
endif
839-
call s:cgetfile(request, a:bang, 1)
839+
call s:cgetfile(request, a:bang, -2)
840840
endfunction
841841

842842
function! s:is_quickfix(...) abort
@@ -880,7 +880,7 @@ function! s:cgetfile(request, all, copen) abort
880880
let height = get(g:, 'dispatch_quickfix_height', 10)
881881
let was_qf = s:is_quickfix()
882882
execute 'botright' (a:copen ? 'copen' : 'cwindow') height
883-
if !was_qf && !a:copen && s:is_quickfix()
883+
if !was_qf && s:is_quickfix() && a:copen !=# -2
884884
wincmd p
885885
endif
886886
endfunction

0 commit comments

Comments
 (0)