Skip to content

Commit

Permalink
Require :chistory for asynchronous dispatch
Browse files Browse the repository at this point in the history
Hopefully for the last time!
  • Loading branch information
tpope committed Jun 9, 2019
1 parent 20acbac commit 9096c8b
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions autoload/dispatch.vim
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,13 @@ function! dispatch#compile_command(bang, args, count, ...) abort

call writefile([], request.file)

let result = s:dispatch(request)
if exists(':chistory')
let result = s:dispatch(request)
else
let result = 0
endif
if result
if !get(request, 'background') && exists(':chistory')
if !get(request, 'background')
call s:cgetfile(request)
if result is 2
exe 'botright copen' get(g:, 'dispatch_quickfix_height', '')
Expand All @@ -883,6 +887,11 @@ function! dispatch#compile_command(bang, args, count, ...) abort
redraw!
let sp = dispatch#shellpipe(request.file)
let dest = request.file . '.complete'
if !exists(':chistory') && request.background
echohl WarningMsg
echo "Asynchronous dispatch requires Vim 8 or higher\n"
echohl NONE
endif
if &shellxquote ==# '"'
silent execute dispatch#bang(request.expanded . ' ' . sp . ' & echo %ERRORLEVEL% > ' . dest)
else
Expand Down Expand Up @@ -1168,6 +1177,9 @@ endfunction
" Section: :AbortDispatch

function! dispatch#abort_command(bang, query, ...) abort
if !exists(':chistory')
return 'echoerr ' .string('Asynchronous dispatch requires Vim 8 or higher')
endif
let i = len(s:makes) - 1
while i >= 0
let request = s:makes[i]
Expand Down

0 comments on commit 9096c8b

Please sign in to comment.