Great work on this @FordLawnmower. You should push these out to the official CodeMirror repo, https://github.com/marijnh/CodeMirror They might just end up in the next release.
I added them to a fork, as per instructions on contributing.
https://github.com/FordLawnmower/CodeMirror/
I looked at that page before . I couldn't really figure out how to submit anything or even leave a comment.