Skip to content

Commit

Permalink
fixed issues in :AsyncReset
Browse files Browse the repository at this point in the history
  • Loading branch information
skywind3000 committed Sep 13, 2022
1 parent a7a83c1 commit 2483bbd
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions plugin/asyncrun.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
" Maintainer: skywind3000 (at) gmail.com, 2016-2022
" Homepage: https://github.com/skywind3000/asyncrun.vim
"
" Last Modified: 2022/09/12 01:46
" Last Modified: 2022/09/13 17:50
"
" Run shell command in background and output to quickfix:
" :AsyncRun[!] [options] {cmd} ...
Expand Down Expand Up @@ -2079,6 +2079,23 @@ function! asyncrun#version()
endfunc


"----------------------------------------------------------------------
" asyncrun - reset
"----------------------------------------------------------------------
function! asyncrun#reset()
call asyncrun#stop('!')
let s:async_state = 0
if exists('s:async_timer')
call timer_stop(s:async_timer)
unlet s:async_timer
endif
if exists('s:async_job')
unlet s:async_job
endif
let s:async_state = 0
endfunc


"----------------------------------------------------------------------
" Commands
"----------------------------------------------------------------------
Expand All @@ -2087,8 +2104,7 @@ command! -bang -nargs=+ -range=0 -complete=file AsyncRun

command! -bar -bang -nargs=0 AsyncStop call asyncrun#stop('<bang>')

let s:script_name = expand('<sfile>:p')
command! -nargs=0 AsyncReset exec 'source ' . fnameescape(s:script_name)
command! -nargs=0 AsyncReset call asyncrun#reset()


"----------------------------------------------------------------------
Expand Down

0 comments on commit 2483bbd

Please sign in to comment.