CodeMirror save event handling: fix #1