regular-express icon indicating copy to clipboard operation
regular-express copied to clipboard

crash when dropping a fresh group

Open ratchetfreak opened this issue 3 years ago • 4 comments

steps to recreate

  1. start fresh
  2. click the plus below the graph
  3. start dragging the hello that appear in the new branch
  4. drop it outside the graph
  5. observe crash

having a drag outside to delete would be nice instead of crash

ratchetfreak avatar Mar 18 '21 16:03 ratchetfreak

testing further it also crashes when you drag everything in a alternative to anywhere on the graph

ratchetfreak avatar Mar 18 '21 17:03 ratchetfreak

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.

bvisness avatar Mar 18 '21 17:03 bvisness

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.

ratchetfreak avatar Mar 19 '21 00:03 ratchetfreak

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.

bvisness avatar Mar 19 '21 01:03 bvisness