Merge template-live-editor
create and document an ugly knob
bugfix: text nodes always have non-nil computed width 'w'
Merge template-live-editor
get _some_ error message out on stack overflow
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.
bugfix
scenario:
- load a file
- move the viewport around
- drop a new file
- quit
Before this commit, the first file's updated viewport is not saved even
though any changes to it are saved.
I think I should start maintaining viewport alongside the file in
program memory, even if the viewport shouldn't be saved to disk with the
graph contents.
bugfix
scenario:
- drop an empty file on the window
- adjust the viewport
- quit creating anything
Before this commit the viewport of the new/empty file was not remembered.
no, that's not right
scenarios:
1. Drop an empty file. You get a node and viewport like on first start.
2. Drop a known file. It loads up and remembers its viewport the last time you edited it.
bugfix: initialize graph when dropping empty file on window
Merge template-live-editor
slightly improve deepcopy everywhere