Possible fix for marijnh/CodeMirror#2497