Skip to content

Commit 95d963b

Browse files
author
skywind3000
committed
2.12.0: support command like ":start xxx" or ":start/b xxx" on windows
1 parent cf4d110 commit 95d963b

File tree

1 file changed

+29
-11
lines changed

1 file changed

+29
-11
lines changed

plugin/asyncrun.vim

Lines changed: 29 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
" Maintainer: skywind3000 (at) gmail.com, 2016-2023
44
" Homepage: https://github.com/skywind3000/asyncrun.vim
55
"
6-
" Last Modified: 2023/09/22 14:44
6+
" Last Modified: 2023/09/25 22:55
77
"
88
" Run shell command in background and output to quickfix:
99
" :AsyncRun[!] [options] {cmd} ...
@@ -1876,15 +1876,33 @@ function! s:run(opts)
18761876
let t = s:StringStrip(l:command)
18771877

18781878
if strpart(t, 0, 1) == ':' && g:asyncrun_strict == 0
1879-
try
1880-
exec strpart(t, 1)
1881-
catch
1882-
redraw
1883-
echohl ErrorMsg
1884-
echo 'AsyncRun: ' . v:exception
1885-
echohl None
1886-
endtry
1887-
return ''
1879+
if 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 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
1896+
try
1897+
exec strpart(t, 1)
1898+
catch
1899+
redraw
1900+
echohl ErrorMsg
1901+
echo 'AsyncRun: ' . v:exception
1902+
echohl None
1903+
endtry
1904+
return ''
1905+
endif
18881906
elseif l:runner != ''
18891907
let obj = deepcopy(l:opts)
18901908
let obj.cmd = command
@@ -2282,7 +2300,7 @@ endfunc
22822300
" asyncrun - version
22832301
"----------------------------------------------------------------------
22842302
function! asyncrun#version()
2285-
return '2.11.24'
2303+
return '2.12.0'
22862304
endfunc
22872305

22882306

0 commit comments

Comments
 (0)