-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
[From https://github.com/bootstrapworld/codemirror-blocks/issues/248]
Start with the code
f(x)
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:
- Fix this.
- Think: will a similar problem plague any other kind of edit? If so, fix that too.
Metadata
Metadata
Assignees
Labels
No labels