Fix/upgrade to CodeMirror 3 event handling