JavaScript code to update an existing codemirror editor.