add CodeMirrorAdapter#detach to remove CodeMirror listeners