It would be a little more realistic to simulate the typing of the invalid character more directly by just doing a `replaceRange()` that inserts the character instead of resetting the text of the whole editor. It doesn't really make that much difference since we tokenize/reparse the whole thing anyway for any edit that involves a structural character, though. So I don't feel strongly that this needs to change...just mentioning it.