skywind3000/asyncrun.vim

-cwd="$(VIM_FILEDIR)" breaks

TornaxO7 opened this issue · 5 comments

Example code (language: C):

#include <stdio.h>
#include <stdlib.h>

int main()
{
    printf("Hi\n");
    return EXIT_SUCCESS;
}

Run with:

:AsyncRun -mode=term -pos=tab -cwd="$(VIM_FILEDIR)" -save=2 gcc -lm % && ./a.out

Getting the following error message:
image

It works, if I remove the -cwd="$(VIM_FILEDIR) part of the command.

remove your quotation:

:AsyncRun -mode=term -pos=tab -cwd=$(VIM_FILEDIR) -save=2 gcc -lm % && ./a.out

It works, thank you!

also I updated asyncrun.vim to mute this error.

I found a bug in your command, % will be interpreted to a file name relative to vim's working directory, if you specify a different directory by -cwd=?, the % should be replaced as `$(VIM_FILENAME)', the correct version is:

:AsyncRun -mode=term -pos=tab -cwd=$(VIM_FILEDIR) -save=2 gcc -lm "$(VIM_FILENAME)" && ./a.out

I had no problems with this command yet, so I didn't change it but thank you for this hint!