Changed change_text to implement new type_in_codemirror function