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: 2020/02/10 06:16
6
+ " Last Modified: 2020/02/10 17:57
7
7
"
8
8
" Run shell command in background and output to quickfix:
9
9
" :AsyncRun[!] [options] {cmd} ...
@@ -1237,7 +1237,7 @@ endfunc
1237
1237
" run command
1238
1238
" ----------------------------------------------------------------------
1239
1239
function ! s: run (opts)
1240
- let l: opts = a: opts
1240
+ let l: opts = deepcopy ( a: opts)
1241
1241
let l: command = a: opts .cmd
1242
1242
let l: retval = ' '
1243
1243
let l: mode = g: asyncrun_mode
@@ -1260,6 +1260,18 @@ function! s:run(opts)
1260
1260
if type (l: mode ) == type (' ' ) && l: mode == ' raw'
1261
1261
let l: mode = 0
1262
1262
let l: opts .raw = 1
1263
+ elseif type (l: mode ) == 0 && l: mode == 6
1264
+ let pos = get (l: opts , ' pos' , ' ' )
1265
+ if pos == ' bang' || pos == ' vim'
1266
+ let l: mode = 2
1267
+ elseif pos == ' extern' || pos == ' external'
1268
+ let l: mode = 4
1269
+ elseif pos == ' system' || pos == ' os'
1270
+ let l: mode = 4
1271
+ elseif pos == ' quickfix'
1272
+ let l: mode = 0
1273
+ let l: opts .raw = 1
1274
+ endif
1263
1275
endif
1264
1276
1265
1277
" process makeprg/grepprg in -program=?
@@ -1637,7 +1649,7 @@ endfunc
1637
1649
" asyncrun -version
1638
1650
" ----------------------------------------------------------------------
1639
1651
function ! asyncrun#version ()
1640
- return ' 2.2.9 '
1652
+ return ' 2.3.0 '
1641
1653
endfunc
1642
1654
1643
1655
@@ -1898,4 +1910,6 @@ if has("autocmd")
1898
1910
endif
1899
1911
1900
1912
1913
+ " vim: set ts = 4 sw = 4 tw = 78 noet :
1914
+
1901
1915
0 commit comments