diff options
author | 2023-03-25 05:53:58 +1100 | |
---|---|---|
committer | 2023-03-25 05:53:58 +1100 | |
commit | 5f97af903c8bc7e3d4d031c9794cd620d3b2af98 (patch) | |
tree | 0052d342c46aee33333b25f3da53c9683c92b8b7 /plugins/console/init.lua | |
parent | fbb67a2764e26c03821e66f896b5417a2bfe682e (diff) |
-Lua engine: run everything in coroutines. (#11019)
* This lets you use emu.wait(...) directly without mucking around creating coroutines.
* Allow emu.wait to accept an attotime argument.
* Added a couple more wait helper functions.
-emu/profiler.h: Actually use scope-based profiling helpers.
* This makes the comment at the top of emu/profile.h less dishonest, and makes it easier to write exception-safe code.
* Got rid of some do { ... } while (0) loops that only existed so break could be used like a goto.
Diffstat (limited to 'plugins/console/init.lua')
-rw-r--r-- | plugins/console/init.lua | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/console/init.lua b/plugins/console/init.lua index f9e712a66a9..7c04184513d 100644 --- a/plugins/console/init.lua +++ b/plugins/console/init.lua @@ -267,6 +267,7 @@ function console.startplugin() end else cmdbuf = cmdbuf .. "\n" .. cmd + ln.historyadd(cmd) local func, err = load(cmdbuf) if not func then if err:match("<eof>") then @@ -276,14 +277,15 @@ function console.startplugin() cmdbuf = "" end else + cmdbuf = "" + stopped = true local status status, err = pcall(func) if not status then print("error: ", err) end - cmdbuf = "" + stopped = false end - ln.historyadd(cmd) end end conth:start(scr:gsub("$PROMPT", prompt)) |