Open raggi opened 7 years ago
Your patch is incorrect, "%" will be expanded automatically by vim in the command line when you press ENTER and before passing to your User Command.
It will be expanded twice in your patch (firstly by vim, secondly by StringReplace).
It must be implemented very carefully by parsing "%" in &makeprg directly.
I demonstrated otherwise. I wouldn't have been here if it worked! :-)
On Feb 13, 2017 12:22 AM, "Linwei" notifications@github.com wrote:
Your patch is incorrect, "%" will be expanded automatically by vim in the command line when you press ENTER and before passing to your User Command.
It will be expanded twice in your patch (firstly by vim, secondly by StringReplace).
It must be implemented very carefully by parsing "%" in &makeprg directly.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/skywind3000/asyncrun.vim/issues/35#issuecomment-279321365, or mute the thread https://github.com/notifications/unsubscribe-auth/AAABXCayAQawKjWSQtYPSktA6xFk00W2ks5rcBLbgaJpZM4L-r2r .
Thank @Konfekt , I took his idea and fixed this issue:
see here.
Summary: I have some makeprg's that use vim
%
expansions. I want both:make
and:AsyncRun
to work consistently. As such I want to continue to use the % style macros. I would like for asyncrun.vim to support makeprg and grepprg that contain%
expansions.When I use
:AsyncRun -program=make
, I expect the same output as:make
, but instead I get, for examplepackage not found %:h
. This is becauseasyncrun#run
does not expand%
macros.I have found a partial solution to the same general problem in https://github.com/timbertson/vim-background-make/commit/404905fdf87d00ef05ce72e106cf485d1ed23f3f
I have also locally applied a less complete patch as follows, which covers only my use case (no escaped expansions in my makeprgs), that could also be used as a possible approach: https://gist.github.com/raggi/3bcbb18183be138f3b24718891921d9b
An example of a makeprg I would like to work:
setlocal makeprg=go\ build\ ./%:h;echo\ package\ %:h;echo;go\ test\ ./%:h
And the corresponding errorformat, demonstrating usage:
If you would like me to prepare a patch, let me know what your preferred approach will be, and I will add this to my TODO list.
Thanks!