Skip to content

Commit

Permalink
add callback mobdebug.onscratch
Browse files Browse the repository at this point in the history
  • Loading branch information
dodo authored and pkulchenko committed Aug 6, 2016
1 parent 5d6478e commit 7dfdcd3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/mobdebug.lua
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ local function debugger_loop(sev, svars, sfile, sline)
status, res = stringify_results(pcall(func))
end
if status then
if mobdebug.onscratch then mobdebug.onscratch(res) end
server:send("200 OK " .. tostring(#res) .. "\n")
server:send(res)
else
Expand Down Expand Up @@ -1638,6 +1639,7 @@ mobdebug.pause = function() step_into = true end
mobdebug.yield = nil -- callback
mobdebug.output = output
mobdebug.onexit = os and os.exit or done
mobdebug.onscratch = nil -- callback
mobdebug.basedir = function(b) if b then basedir = b end return basedir end

return mobdebug

0 comments on commit 7dfdcd3

Please sign in to comment.