Paginator that uses all available screen/window width

bugfix: show error message on infinite recursion

I fixed the following scenario in template-live-editor2: Windows.main.draw = function() f() end

f = function() f() end

Before this change, template-live-editor2 would crash but not throw an error.

While this happens on infinite recursion, it really needed just a call stack deeper than some threshold which triggers the '…' in the stack trace.

Summary of error handling in Lua and LÖVE:

  • errors in the xpcall handler silently crash the program. I always knew this. Error handlers are hard, because they must never throw an error no matter what situation they find themselves in. But it's impossible to know in advance all the situations they find themselves in.
  • in addition to this, LÖVE has some secret sauce that causes errors in the xpcall handler (NOT love.errorhandler, which I'm not using lately) to only interrupt the current frame, and resume on the next frame. They don't crash the entire program.

This commit just ports the change to template-live-editor. However, the following scenario still silently crashes without an error message:

on.draw = function() f() end

f = function() f() end

The crash happens some time after the call to string.match in cleaned_up_filename. Control returns from string.match. However, any attempt to interact with the result of string.match fails.

Clearly there's something here I still don't understand.

Created by  akkartik  on March 1, 2025
RVFYJCLJ5TUNFBDEUDWG4DJIVE6YVHHUI7JIN4LRE56FPS2XBHEAC
Change contents