|
3 | 3 | " Maintainer: skywind3000 (at) gmail.com, 2016-2022
|
4 | 4 | " Homepage: https://github.com/skywind3000/asyncrun.vim
|
5 | 5 | "
|
6 |
| -" Last Modified: 2022/11/13 01:42 |
| 6 | +" Last Modified: 2022/11/19 01:07 |
7 | 7 | "
|
8 | 8 | " Run shell command in background and output to quickfix:
|
9 | 9 | " :AsyncRun[!] [options] {cmd} ...
|
@@ -1354,7 +1354,7 @@ function! s:terminal_init(opts)
|
1354 | 1354 | if get(a:opts, 'listed', 1) == 0
|
1355 | 1355 | setlocal nobuflisted
|
1356 | 1356 | endif
|
1357 |
| - let hidden = get(g:, 'asyncrun_term_hidden', 'wipe') |
| 1357 | + let hidden = get(g:, 'asyncrun_term_hidden', '') |
1358 | 1358 | let hidden = get(a:opts, 'hidden', hidden)
|
1359 | 1359 | if type(hidden) == type(0)
|
1360 | 1360 | let t = (hidden)? 'hide' : 'wipe'
|
@@ -1421,9 +1421,16 @@ function! s:terminal_exit(...)
|
1421 | 1421 | unlet s:async_term[pid]
|
1422 | 1422 | let g:asyncrun_code = code
|
1423 | 1423 | let g:asyncrun_name = info.name
|
1424 |
| - if info.close != 0 |
1425 |
| - let bid = info.bid |
1426 |
| - if bid >= 0 |
| 1424 | + let bid = info.bid |
| 1425 | + if bid >= 0 |
| 1426 | + let need_wipe = get(g:, 'asyncrun_term_wipe', 0) |
| 1427 | + if need_wipe |
| 1428 | + let bh = getbufvar(bid, '&bufhidden', '') |
| 1429 | + if empty(bh) |
| 1430 | + call setbufvar(bid, '&bufhidden', 'wipe') |
| 1431 | + endif |
| 1432 | + endif |
| 1433 | + if info.close != 0 |
1427 | 1434 | if getbufvar(bid, '&bt', '') == 'terminal'
|
1428 | 1435 | silent! exec "bd! " . bid
|
1429 | 1436 | endif
|
@@ -2117,7 +2124,7 @@ endfunc
|
2117 | 2124 | " asyncrun - version
|
2118 | 2125 | "----------------------------------------------------------------------
|
2119 | 2126 | function! asyncrun#version()
|
2120 |
| - return '2.11.2' |
| 2127 | + return '2.11.3' |
2121 | 2128 | endfunc
|
2122 | 2129 |
|
2123 | 2130 |
|
|
0 commit comments