|
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/05 06:23 |
| 6 | +" Last Modified: 2020/02/05 06:36 |
7 | 7 | "
|
8 | 8 | " Run shell command in background and output to quickfix:
|
9 | 9 | " :AsyncRun[!] [options] {cmd} ...
|
@@ -1090,11 +1090,15 @@ function! s:start_in_terminal(opts)
|
1090 | 1090 | else
|
1091 | 1091 | exec cmd . ' ' . command
|
1092 | 1092 | endif
|
1093 |
| - setlocal nonumber signcolumn=no norelativenumber |
| 1093 | + if &bt == 'terminal' |
| 1094 | + setlocal nonumber signcolumn=no norelativenumber |
| 1095 | + endif |
1094 | 1096 | else
|
1095 | 1097 | exec 'tabe term://'. fnameescape(command)
|
1096 |
| - setlocal nonumber signcolumn=no norelativenumber |
1097 |
| - startinsert |
| 1098 | + if &bt == 'terminal' |
| 1099 | + setlocal nonumber signcolumn=no norelativenumber |
| 1100 | + startinsert |
| 1101 | + endif |
1098 | 1102 | endif
|
1099 | 1103 | return 0
|
1100 | 1104 | elseif pos == 'cur' || pos == 'curwin' || pos == 'current'
|
@@ -1150,13 +1154,17 @@ function! s:start_in_terminal(opts)
|
1150 | 1154 | else
|
1151 | 1155 | exec cmd . ' ++kill=term ' . command
|
1152 | 1156 | endif
|
1153 |
| - setlocal nonumber signcolumn=no norelativenumber |
| 1157 | + if &bt == 'terminal' |
| 1158 | + setlocal nonumber signcolumn=no norelativenumber |
| 1159 | + endif |
1154 | 1160 | else
|
1155 | 1161 | exec 'term '. command
|
1156 |
| - setlocal nonumber signcolumn=no norelativenumber |
1157 |
| - startinsert |
| 1162 | + if &bt == 'terminal' |
| 1163 | + setlocal nonumber signcolumn=no norelativenumber |
| 1164 | + startinsert |
| 1165 | + endif |
1158 | 1166 | endif
|
1159 |
| - if focus == 0 |
| 1167 | + if focus == 0 && &bt == 'terminal' |
1160 | 1168 | silent! stopinsert
|
1161 | 1169 | call win_gotoid(origin)
|
1162 | 1170 | endif
|
@@ -1562,7 +1570,7 @@ endfunc
|
1562 | 1570 | " asyncrun -version
|
1563 | 1571 | "----------------------------------------------------------------------
|
1564 | 1572 | function! asyncrun#version()
|
1565 |
| - return '2.2.4' |
| 1573 | + return '2.2.5' |
1566 | 1574 | endfunc
|
1567 | 1575 |
|
1568 | 1576 |
|
|
0 commit comments