|
3 | 3 | " Maintainer: skywind3000 (at) gmail.com, 2016, 2017, 2018, 2019, 2020
|
4 | 4 | " Homepage: http://www.vim.org/scripts/script.php?script_id=5431
|
5 | 5 | "
|
6 |
| -" Last Modified: 2021/01/12 19:44 |
| 6 | +" Last Modified: 2021/01/28 18:02 |
7 | 7 | "
|
8 | 8 | " Run shell command in background and output to quickfix:
|
9 | 9 | " :AsyncRun[!] [options] {cmd} ...
|
@@ -1387,6 +1387,7 @@ function! s:run(opts)
|
1387 | 1387 | let l:modemap['external'] = 4
|
1388 | 1388 | let l:modemap['quickfix'] = 0
|
1389 | 1389 | let l:modemap['vim'] = 2
|
| 1390 | + let l:modemap['wait'] = 3 |
1390 | 1391 |
|
1391 | 1392 | let l:mode = get(l:modemap, l:mode, l:mode)
|
1392 | 1393 |
|
@@ -1599,6 +1600,11 @@ function! s:run(opts)
|
1599 | 1600 | call s:AutoCmd('Stop')
|
1600 | 1601 | endif
|
1601 | 1602 | elseif l:mode == 3
|
| 1603 | + let autocmd = get(opts, 'autocmd', 0) |
| 1604 | + if autocmd != 0 |
| 1605 | + call s:AutoCmd('Pre') |
| 1606 | + call s:AutoCmd('Start') |
| 1607 | + endif |
1602 | 1608 | if s:asyncrun_windows == 0
|
1603 | 1609 | let l:retval = system(l:command)
|
1604 | 1610 | let g:asyncrun_shell_error = v:shell_error
|
@@ -1651,6 +1657,9 @@ function! s:run(opts)
|
1651 | 1657 | if opts.post != ''
|
1652 | 1658 | exec opts.post
|
1653 | 1659 | endif
|
| 1660 | + if autocmd != 0 |
| 1661 | + call s:AutoCmd('Stop') |
| 1662 | + endif |
1654 | 1663 | elseif l:mode <= 5
|
1655 | 1664 | let script = get(g:, 'asyncrun_script', '')
|
1656 | 1665 | if script != '' && l:mode == 4
|
@@ -1868,7 +1877,7 @@ endfunc
|
1868 | 1877 | " asyncrun - version
|
1869 | 1878 | "----------------------------------------------------------------------
|
1870 | 1879 | function! asyncrun#version()
|
1871 |
| - return '2.7.8' |
| 1880 | + return '2.7.9' |
1872 | 1881 | endfunc
|
1873 | 1882 |
|
1874 | 1883 |
|
|
0 commit comments