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/03/06 21:45
6
+ " Last Modified: 2020/03/07 05:57
7
7
"
8
8
" Run shell command in background and output to quickfix:
9
9
" :AsyncRun[!] [options] {cmd} ...
@@ -1114,6 +1114,7 @@ function! s:start_in_terminal(opts)
1114
1114
endif
1115
1115
endif
1116
1116
endfor
1117
+ let focus = get (a: opts , ' focus' , 1 )
1117
1118
if pos == ' tab'
1118
1119
if get (a: opts , ' reuse' , 0 ) == 0
1119
1120
exec " tab split"
@@ -1161,6 +1162,10 @@ function! s:start_in_terminal(opts)
1161
1162
if has_key (a: opts , ' hidden' )
1162
1163
exec ' setlocal bufhidden=' . (hidden ? ' hide' : ' ' )
1163
1164
endif
1165
+ if focus == 0
1166
+ exec has (' nvim' )? ' stopinsert' : ' '
1167
+ exec ' tabprevious'
1168
+ endif
1164
1169
endif
1165
1170
return 0
1166
1171
elseif pos == ' cur' || pos == ' curwin' || pos == ' current'
@@ -1186,7 +1191,6 @@ function! s:start_in_terminal(opts)
1186
1191
let uid = win_getid ()
1187
1192
keepalt noautocmd windo call s: save_restore_view (0 )
1188
1193
keepalt noautocmd call win_gotoid (uid)
1189
- let focus = get (a: opts , ' focus' , 1 )
1190
1194
let origin = win_getid ()
1191
1195
if avail < 0
1192
1196
let rows = get (a: opts , ' rows' , ' ' )
@@ -1725,7 +1729,7 @@ endfunc
1725
1729
" asyncrun - version
1726
1730
" ----------------------------------------------------------------------
1727
1731
function ! asyncrun#version ()
1728
- return ' 2.5.4 '
1732
+ return ' 2.5.5 '
1729
1733
endfunc
1730
1734
1731
1735
0 commit comments