Skip to content

Commit c37c230

Browse files
author
skywind3000
committed
simplify event dispatch routines
1 parent aa8a99e commit c37c230

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

plugin/asyncrun.vim

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: skywind3000 (at) gmail.com, 2016-2022
44
" Homepage: https://github.com/skywind3000/asyncrun.vim
55
"
6-
" Last Modified: 2022/06/14 20:43
6+
" Last Modified: 2022/09/05 19:49
77
"
88
" Run shell command in background and output to quickfix:
99
" :AsyncRun[!] [options] {cmd} ...
@@ -1537,24 +1537,7 @@ endfunc
15371537
"----------------------------------------------------------------------
15381538
function! s:DispatchEvent(name, ...)
15391539
if has_key(g:asyncrun_event, a:name)
1540-
let l:F = g:asyncrun_event[a:name]
1541-
if type(l:F) == type('')
1542-
let test = l:F
1543-
unlet l:F
1544-
let l:F = function(test)
1545-
endif
1546-
if a:0 == 0
1547-
call l:F()
1548-
else
1549-
let args = []
1550-
for index in range(a:0)
1551-
let args += ['a:' . (index + 1)]
1552-
endfor
1553-
let text = join(args, ',')
1554-
let cmd = 'call l:F(' . text . ')'
1555-
exec cmd
1556-
endif
1557-
unlet l:F
1540+
call call(g:asyncrun_event[a:name], a:000)
15581541
endif
15591542
endfunc
15601543

@@ -2092,7 +2075,7 @@ endfunc
20922075
" asyncrun - version
20932076
"----------------------------------------------------------------------
20942077
function! asyncrun#version()
2095-
return '2.9.12'
2078+
return '2.9.13'
20962079
endfunc
20972080

20982081

0 commit comments

Comments
 (0)