Of course, I understand committing a minimal diff would be the preferred way. However, I didn’t notice any problems with undo specifically in my case. Cmd+Z simply reverts to the previous content. Could you elaborate on this, if you find the time?
Edit: Ah, I think I got it. You mean, undo wouldn’t make any sense, if we’re talking two different documents after the replacement. Which isn’t the case in my app.