regular-express
regular-express copied to clipboard
crash when dropping a fresh group
steps to recreate
- start fresh
- click the plus below the graph
- start dragging the hello that appear in the new branch
- drop it outside the graph
- observe crash
having a drag outside to delete would be nice instead of crash
testing further it also crashes when you drag everything in a alternative to anywhere on the graph
Yep, I've seen this before - fun fact, when I showed my coworker, the very first thing he did was perfectly reproduce this bug 🙃
What's happening is that I automatically delete empty union branches when they lose focus, but this means that when you drag away a full expression, the original location gets deleted. Then when you drop it in an invalid place, I try to put it back.
you shouldn't be deleting empty union branches though because they are necessary for doing (stuff)?
when there are 2 empty unions that start and end on the same point then sure delete the extra one.
Yep, for sure, it's just a holdover from an earlier time. At this point my keyboard editing stuff is good enough that I think I can just render an empty expression state and not automatically remove anything.