moe
moe copied to clipboard
QuickRun feature not autodetecting common build/run commands
So I tested your latest QuickRun feature work, and it looks like you have to set the command in the config for now.
I think it should be possible to detect the source file type and then to use some default commands, or use the interpreter that is set in the shebang.
If the file starts with:
#!/bin/sh
The file should be run with /bin/sh and so on and so forth.
If the file extension is .nim, you can assume that the user wants to build and run the file with nim.
Another idea would be, if there's no detectable default run/build command for what's in the buffer, and if there's no setting in the config, to ask the user for the command that should be used and save that for the buffer.
@tobimensch
Thank you for your advice. Anyway, I will add support for shell script.
@fox0430 Thanks, just tested the latest changes you made, and now :run works for shell scripts, which is very nice.
Although you still have to save it to disk beforehand.
It would be neat if compilation/run/build from an unsaved buffer would also work, then you could also make a run/build from a selection/part-of-a-buffer.