marijnh/CodeMirror — pull request #1358 by mikelehen (2013-03-14 05:45:33+00:00)
Title: Add 'removedText' to change event object.

If you're amenable, this is what I had in mind for adding 'removedText' to the change object. I'm happy to make any tweaks if this isn't suitable as-is.

In particular, if you'd prefer a name other than 'removedText', let me know (I thought about oldText, replacedText, and deletedText as alternatives).

Also, I am /not/ currently including it in the beforeChange event object. I figure it's not necessary since you can easily calculate it yourself, and omitting it is a slight optimization, since we'd have to recalculate it in the case that the beforeChange handler calls .update() or if the change is split by readonly regions. But if you'd prefer beforeChange include it, it shouldn't be hard.