|
3 | 3 | " Maintainer: skywind3000 (at) gmail.com, 2016-2022
|
4 | 4 | " Homepage: https://github.com/skywind3000/asyncrun.vim
|
5 | 5 | "
|
6 |
| -" Last Modified: 2022/01/02 09:15 |
| 6 | +" Last Modified: 2022/02/03 22:15 |
7 | 7 | "
|
8 | 8 | " Run shell command in background and output to quickfix:
|
9 | 9 | " :AsyncRun[!] [options] {cmd} ...
|
@@ -407,6 +407,11 @@ function! s:AsyncRun_Job_Update(count, ...)
|
407 | 407 | let &l:efm = s:async_info.errorformat
|
408 | 408 | let &g:efm = s:async_info.errorformat
|
409 | 409 | endif
|
| 410 | + let pathfix = get(g:, 'asyncrun_pathfix', 0) |
| 411 | + if pathfix != 0 |
| 412 | + let l:previous_cwd = getcwd() |
| 413 | + silent! call s:chdir(s:async_info.cwd) |
| 414 | + endif |
410 | 415 | let l:raw = (&efm == '')? 1 : 0
|
411 | 416 | if s:async_info.raw == 1
|
412 | 417 | let l:raw = 1
|
@@ -469,6 +474,9 @@ function! s:AsyncRun_Job_Update(count, ...)
|
469 | 474 | endif
|
470 | 475 | unlet array
|
471 | 476 | endif
|
| 477 | + if pathfix != 0 |
| 478 | + silent! call s:chdir(l:previous_cwd) |
| 479 | + endif |
472 | 480 | if g:asyncrun_local != 0
|
473 | 481 | if l:efm1 != &g:efm | let &g:efm = l:efm1 | endif
|
474 | 482 | if l:efm2 != &l:efm | let &l:efm = l:efm2 | endif
|
@@ -1700,6 +1708,7 @@ function! s:run(opts)
|
1700 | 1708 | let s:async_info.range_buf = opts.range_buf
|
1701 | 1709 | let s:async_info.strip = opts.strip
|
1702 | 1710 | let s:async_info.append = opts.append
|
| 1711 | + let s:async_info.cwd = getcwd() |
1703 | 1712 | let s:async_info.once = get(opts, 'once', 0)
|
1704 | 1713 | let s:async_info.encoding = get(opts, 'encoding', g:asyncrun_encs)
|
1705 | 1714 | if s:AsyncRun_Job_Start(l:command) != 0
|
@@ -2046,7 +2055,7 @@ endfunc
|
2046 | 2055 | " asyncrun - version
|
2047 | 2056 | "----------------------------------------------------------------------
|
2048 | 2057 | function! asyncrun#version()
|
2049 |
| - return '2.9.8' |
| 2058 | + return '2.9.9' |
2050 | 2059 | endfunc
|
2051 | 2060 |
|
2052 | 2061 |
|
|
0 commit comments