Optimized CodeMirror highlighting