diff --git a/main.lua b/main.lua index 770c568..b6a7aca 100644 --- a/main.lua +++ b/main.lua @@ -43,6 +43,12 @@ function runitCommand(bp) -- bp BufPane shell.RunInteractiveShell(cmd, true, false) end +function makeJobExit(out, args) + local out = string.sub(out, -79) + out = string.gsub(out, "\n", " ") + micro.InfoBar():Message("'make' done: ...", out) +end + function makeup(bg) -- Go up directories until a Makefile is found and run 'make'. @@ -75,12 +81,11 @@ function makeup(bg) if err ~= nil then micro.InfoBar():Message("(not found in ", pwd, ")") else - micro.InfoBar():Message("Running make, found Makefile in ", pwd) if bg then - local outfunc, err = shell.RunBackgroundShell("make") - -- local out = string.sub(outfunc(), -60) -- this will block, can't edit when blocking - -- micro.InfoBar():Message("'make' done: ", out) + micro.InfoBar():Message("Background running make, found Makefile in ", pwd) + shell.JobStart("make", nil, nil, makeJobExit, nil) else + micro.InfoBar():Message("Running make, found Makefile in ", pwd) local out, err = shell.RunInteractiveShell("make", true, true) end return diff --git a/repo.json b/repo.json index 1067697..6b81705 100644 --- a/repo.json +++ b/repo.json @@ -4,6 +4,13 @@ "Website": "https://github.com/terokarvinen/micro-run", "Tags": ["run", "execute", "Go", "Python", "Bash", "Lua", "F5"], "Versions": [ + { + "Version": "0.0.7", + "Url": "https://github.com/terokarvinen/micro-run/archive/v0.0.7.zip", + "Require": { + "micro": ">=2.0.0" + } + }, { "Version": "0.0.6", "Url": "https://github.com/terokarvinen/micro-run/archive/v0.0.6.zip",