Skip to content

Commit b2fb2c9

Browse files
committed
:visual to make exit code 0
1 parent 4ad8ba4 commit b2fb2c9

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

js/jscompiler.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,6 +907,15 @@ function! s:main() abort
907907
call writefile([v:exception], has('win32') ? 'conout$' : '/dev/stderr')
908908
cquit
909909
endtry
910+
if mode(1) ==# 'ce'
911+
" This :visual is needed to make exit code 0 for old vim.
912+
" Exit code is set to 1, Vim exit from Ex mode after an error
913+
" output is performed even if the error is caught by try-catch.
914+
"
915+
" This problem is fixed at Vim v.8.0.0184.
916+
" https://github.com/vim/vim/releases/tag/v8.0.0184
917+
visual
918+
endif
910919
endfunction
911920

912921
call s:main()

py/pycompiler.vim

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,15 @@ function! s:main() abort
879879
call writefile([v:exception], has('win32') ? 'conout$' : '/dev/stderr')
880880
cquit
881881
endtry
882+
if mode(1) ==# 'ce'
883+
" This :visual is needed to make exit code 0 for old vim.
884+
" Exit code is set to 1, Vim exit from Ex mode after an error
885+
" output is performed even if the error is caught by try-catch.
886+
"
887+
" This problem is fixed at Vim v.8.0.0184.
888+
" https://github.com/vim/vim/releases/tag/v8.0.0184
889+
visual
890+
endif
882891
endfunction
883892

884893
call s:main()

0 commit comments

Comments
 (0)