There is a hacked version of CodeMirror + New WikiText Editor here: https://gerrit.wikimedia.org/r/#/c/343878/
This version works by loading CodeMirror underneath the WikiText editor surface, making the text and background of the WikiText editor transparent, and syncing user input from the WikiText editor to the CodeMirror surface as it is entered.
One potential issues with this approach is properly syncing between the 2 surfaces: "While it is possible to get the font sizes, widths and line-heights to match up perfectly in my clean test environment, a single half-pixel error could change the text flow, and result in a catastrophic model/view sync issue - where the user thinks they are typing into one part of the document, but are actually in another. This would be incredibly frustrating and possibly lead to document corruption." – Ed
Use the existing hack to explore this issue and see if it is something we should actually be worried about.