diff --git a/.gitignore b/.gitignore index e6aad7c..094a853 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ testWorkflows .vscode todo.txt Flexbox2.lua +markdown2.lua diff --git a/src/elements/Program.lua b/src/elements/Program.lua index 8afa784..e189ce5 100644 --- a/src/elements/Program.lua +++ b/src/elements/Program.lua @@ -106,6 +106,10 @@ end ---@private function BasaltProgram:resume(event, ...) + local args = {...} + if(event:find("mouse_"))then + args[2], args[3] = self.program:getRelativePosition(args[2], args[3]) + end if self.coroutine==nil or coroutine.status(self.coroutine)=="dead" then self.program.set("running", false) return end if(self.filter~=nil)then if(event~=self.filter)then return end @@ -113,7 +117,7 @@ function BasaltProgram:resume(event, ...) end local current = term.current() term.redirect(self.window) - local ok, result = coroutine.resume(self.coroutine, event, ...) + local ok, result = coroutine.resume(self.coroutine, event, table.unpack(args)) term.redirect(current) if ok then