Skip to content

Commit 062558a

Browse files
author
skywind3000
committed
fixed: windows - exit code is always zero
1 parent 0e2bda9 commit 062558a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugin/asyncrun.vim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: skywind3000 (at) gmail.com, 2016, 2017, 2018, 2019, 2020
44
" Homepage: http://www.vim.org/scripts/script.php?script_id=5431
55
"
6-
" Last Modified: 2020/03/11 14:52
6+
" Last Modified: 2020/03/12 18:54
77
"
88
" Run shell command in background and output to quickfix:
99
" :AsyncRun[!] [options] {cmd} ...
@@ -897,7 +897,9 @@ function! s:ScriptWrite(command, pause)
897897
let $VIM_COMMAND = a:command
898898
let $VIM_PAUSE = (a:pause)? 'pause' : ''
899899
let lines += ["call %VIM_COMMAND% \r"]
900+
let lines += ["set VIM_EXITCODE=%ERRORLEVEL%\r"]
900901
let lines += ["call %VIM_PAUSE% \r"]
902+
let lines += ["exit %VIM_EXITCODE%\r"]
901903
else
902904
let shell = (g:asyncrun_shell != '')? g:asyncrun_shell : (&shell)
903905
let lines = ['#! ' . shell]
@@ -1827,7 +1829,7 @@ endfunc
18271829
" asyncrun - version
18281830
"----------------------------------------------------------------------
18291831
function! asyncrun#version()
1830-
return '2.6.6'
1832+
return '2.6.7'
18311833
endfunc
18321834

18331835

0 commit comments

Comments
 (0)