From 347416bd6da30a66b9f66351d4dbd783e44017c9 Mon Sep 17 00:00:00 2001 From: skywind3000 Date: Mon, 16 Apr 2018 16:20:36 +0800 Subject: [PATCH] 1. handle makeprg/grepprg correctly 2. accept `%` and `$*` macros in makeprg/grepprg 3. close https://github.com/skywind3000/asyncrun.vim/issues/96 https://github.com/skywind3000/asyncrun.vim/issues/84 and https://github.com/skywind3000/asyncrun.vim/issues/35 --- README.md | 1 + plugin/asyncrun.vim | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 587f986..fc57632 100644 --- a/README.md +++ b/README.md @@ -226,6 +226,7 @@ See: [Cooperate with famous plugins](https://github.com/skywind3000/asyncrun.vim ## History +- 1.3.25 (2018-04-16): handle makeprg/grepprg correctly, accept `%` and `$*` macros. - 1.3.24 (2018-04-13): remove trailing ^M on windows. - 1.3.23 (2018-04-03): back compatible to vim 7.3, can fall back to mode 1 in old vim. - 1.3.22 (2018-03-11): new option `g:asyncrun_open` to open quickfix window automatically at given height. diff --git a/plugin/asyncrun.vim b/plugin/asyncrun.vim index 7db15a1..bf142c4 100644 --- a/plugin/asyncrun.vim +++ b/plugin/asyncrun.vim @@ -3,7 +3,7 @@ " Maintainer: skywind3000 (at) gmail.com, 2016, 2017, 2018 " Homepage: http://www.vim.org/scripts/script.php?script_id=5431 " -" Last Modified: 2018/04/13 16:42 +" Last Modified: 2018/04/16 16:12 " " Run shell command in background and output to quickfix: " :AsyncRun[!] [options] {cmd} ... @@ -963,6 +963,9 @@ function! s:run(opts) let l:command = l:program endif let l:command = s:StringStrip(l:command) + let s:async_program_cmd = '' + silent exec 'AsyncRun -program=parse @ '. l:command + let l:command = s:async_program_cmd endif if l:command =~ '^\s*$' @@ -1134,6 +1137,12 @@ function! asyncrun#run(bang, opts, args) endfor endif + " parse makeprg/grepprg and return + if l:opts.program == 'parse' + let s:async_program_cmd = l:command + return s:async_program_cmd + endif + " check cwd if l:opts.cwd != '' for [l:key, l:val] in items(l:macros) @@ -1212,7 +1221,7 @@ endfunc " asyncrun -version "---------------------------------------------------------------------- function! asyncrun#version() - return '1.3.24' + return '1.3.25' endfunc