diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/ui.lua | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/core/ui.lua b/core/ui.lua index b7f110b7..1ec21be1 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -501,13 +501,15 @@ if CURSES then end) end -local lua_error = (not WIN32 and '^/' or '^%a:[/\\]') .. '.-%.lua:%d+:' --- Print internal Lua error messages as they are reported. --- Attempt to mimic the Lua interpreter's error message format so tools that --- look for it can recognize these errors too. -events_connect(events.ERROR, function(text) - if text and text:find(lua_error) then text = 'lua: ' .. text end -- mimic Lua - ui.print(text) +events.connect(events.INITIALIZED, function() + local lua_error = (not WIN32 and '^/' or '^%a:[/\\]') .. '.-%.lua:%d+:' + -- Print internal Lua error messages as they are reported. + -- Attempt to mimic the Lua interpreter's error message format so tools that + -- look for it can recognize these errors too. + events_connect(events.ERROR, function(text) + if text and text:find(lua_error) then text = 'lua: ' .. text end + ui.print(text) + end) end) --[[ The tables below were defined in C. |