Similar correction on event registration with codemirror instance.