From 15d5d0ecf39da2dea20b1dafa0a17f48b459a433 Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Wed, 20 Sep 2023 09:52:31 +0800 Subject: [PATCH] add try/catch for Ex commands starting with colon --- plugin/asyncrun.vim | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/plugin/asyncrun.vim b/plugin/asyncrun.vim index efa5f9e..5ba3954 100644 --- a/plugin/asyncrun.vim +++ b/plugin/asyncrun.vim @@ -3,7 +3,7 @@ " Maintainer: skywind3000 (at) gmail.com, 2016-2023 " Homepage: https://github.com/skywind3000/asyncrun.vim " -" Last Modified: 2023/09/19 23:48 +" Last Modified: 2023/09/20 09:47 " " Run shell command in background and output to quickfix: " :AsyncRun[!] [options] {cmd} ... @@ -621,7 +621,14 @@ function! s:AsyncRun_Job_OnFinish() exec "norm! \" endif if s:async_info.post != '' - exec s:async_info.post + try + exec s:async_info.post + catch + redraw + echohl ErrorMsg + echo 'AsyncRun: ' . v:exception + echohl None + endtry let s:async_info.post = '' endif if g:asyncrun_exit != "" @@ -2274,7 +2281,7 @@ endfunc " asyncrun - version "---------------------------------------------------------------------- function! asyncrun#version() - return '2.11.22' + return '2.11.23' endfunc