upgrading to codemirror 4.0 (this is raw, need to reimplement optimization)