Skip to content

Commit

Permalink
simplify event dispatch routines
Browse files Browse the repository at this point in the history
  • Loading branch information
skywind3000 committed Sep 6, 2022
1 parent aa8a99e commit c37c230
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 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/06/14 20:43
" Last Modified: 2022/09/05 19:49
"
" Run shell command in background and output to quickfix:
" :AsyncRun[!] [options] {cmd} ...
Expand Down Expand Up @@ -1537,24 +1537,7 @@ endfunc
"----------------------------------------------------------------------
function! s:DispatchEvent(name, ...)
if has_key(g:asyncrun_event, a:name)
let l:F = g:asyncrun_event[a:name]
if type(l:F) == type('')
let test = l:F
unlet l:F
let l:F = function(test)
endif
if a:0 == 0
call l:F()
else
let args = []
for index in range(a:0)
let args += ['a:' . (index + 1)]
endfor
let text = join(args, ',')
let cmd = 'call l:F(' . text . ')'
exec cmd
endif
unlet l:F
call call(g:asyncrun_event[a:name], a:000)
endif
endfunc

Expand Down Expand Up @@ -2092,7 +2075,7 @@ endfunc
" asyncrun - version
"----------------------------------------------------------------------
function! asyncrun#version()
return '2.9.12'
return '2.9.13'
endfunc


Expand Down

0 comments on commit c37c230

Please sign in to comment.