|
3 | 3 | " Maintainer: skywind3000 (at) gmail.com, 2016-2023
|
4 | 4 | " Homepage: https://github.com/skywind3000/asyncrun.vim
|
5 | 5 | "
|
6 |
| -" Last Modified: 2023/09/25 23:10 |
| 6 | +" Last Modified: 2023/09/25 23:19 |
7 | 7 | "
|
8 | 8 | " Run shell command in background and output to quickfix:
|
9 | 9 | " :AsyncRun[!] [options] {cmd} ...
|
@@ -1875,33 +1875,28 @@ function! s:run(opts)
|
1875 | 1875 | let g:asyncrun_cmd = l:command
|
1876 | 1876 | let t = s:StringStrip(l:command)
|
1877 | 1877 |
|
1878 |
| - if strpart(t, 0, 1) == ':' && g:asyncrun_strict == 0 |
1879 |
| - if s:asyncrun_windows && t =~ '^:\s*\!\s*start\s*\/b\s\+' |
1880 |
| - let t = matchstr(t, '^:\s*\!\s*start\s*\/b\s\+\zs.*$') |
1881 |
| - let t = s:StringStrip(t) |
1882 |
| - if t == '' |
1883 |
| - return '' |
1884 |
| - endif |
1885 |
| - let l:command = t |
1886 |
| - let l:mode = 5 |
1887 |
| - elseif s:asyncrun_windows && t =~ '^:\s*\!\s*start\s\+' |
1888 |
| - let t = matchstr(t, '^:\s*\!\s*start\s\+\zs.*$') |
1889 |
| - let t = s:StringStrip(t) |
1890 |
| - if t == '' |
1891 |
| - return '' |
1892 |
| - endif |
1893 |
| - let l:command = t |
1894 |
| - let l:mode = 4 |
1895 |
| - else |
| 1878 | + if strpart(t, 0, 1) == ':' |
| 1879 | + if t !~ '^:\s*\!\!\+' |
1896 | 1880 | try
|
1897 |
| - exec strpart(t, 1) |
| 1881 | + if g:asyncrun_strict == 0 |
| 1882 | + exec strpart(t, 1) |
| 1883 | + endif |
1898 | 1884 | catch
|
1899 | 1885 | redraw
|
1900 | 1886 | echohl ErrorMsg
|
1901 | 1887 | echo 'AsyncRun: ' . v:exception
|
1902 | 1888 | echohl None
|
1903 | 1889 | endtry
|
1904 | 1890 | return ''
|
| 1891 | + else |
| 1892 | + let b = matchstr(t, '^:\s*\!\zs\!\+') |
| 1893 | + let t = matchstr(t, '^:\s*\!\!\+\zs.*$') |
| 1894 | + let t = s:StringStrip(t) |
| 1895 | + if t == '' |
| 1896 | + return '' |
| 1897 | + endif |
| 1898 | + let l:command = t |
| 1899 | + let l:mode = (strlen(b) == 1)? 4 : 5 |
1905 | 1900 | endif
|
1906 | 1901 | elseif l:runner != ''
|
1907 | 1902 | let obj = deepcopy(l:opts)
|
@@ -2300,7 +2295,7 @@ endfunc
|
2300 | 2295 | " asyncrun - version
|
2301 | 2296 | "----------------------------------------------------------------------
|
2302 | 2297 | function! asyncrun#version()
|
2303 |
| - return '2.12.1' |
| 2298 | + return '2.12.2' |
2304 | 2299 | endfunc
|
2305 | 2300 |
|
2306 | 2301 |
|
|
0 commit comments