[From https://github.com/bootstrapworld/codemirror-blocks/issues/248]
Start with the code
Now double-click on the drop target to one side of the x, and insert "" or " ".
This should be a no-op: you haven't inserted anything. Instead, it's a parse error. What happens is:
- A copy of the node
f(x) is made.
- A new child is inserted into this node. This child is a fake node that prints itself out as " ", since that's what you inserted.
- The copied node is pretty-printed, producing
f(x, ).
- The edit is thus taken to be:
f(x) => f(x, ).
- Hence, parse error.
To fix this, I think we should add a check to see if text is purely whitespace in src/edits/performEdits/edit_insert(). If it is, skip the insert because nothing is being inserted.
TODO:
[From https://github.com/bootstrapworld/codemirror-blocks/issues/248]
Start with the code
Now double-click on the drop target to one side of the
x, and insert "" or " ".This should be a no-op: you haven't inserted anything. Instead, it's a parse error. What happens is:
f(x)is made.f(x, ).f(x) => f(x, ).To fix this, I think we should add a check to see if
textis purely whitespace insrc/edits/performEdits/edit_insert(). If it is, skip the insert because nothing is being inserted.TODO: