         @element     = @editor.element
 
         # window.w = @
+
         # replace undo/redo by sync-aware versions
         for cm in [@codemirror, @codemirror1]
             cm.undo = @undo

            @_set_syncstring_to_codemirror()
        value = @_syncstring.undo().to_str()
        cm.setValueNoJump(value, true)
        @save_state_debounce?()
        @_last_change_time = new Date()

    # per-session sync-aware redo

            throw Error("doc must have a to_str method, but is doc='#{doc}', typeof(doc)='#{typeof(doc)}'")
        value = doc.to_str()
        @focused_codemirror().setValueNoJump(value, true)
        @save_state_throttle?()
        @_last_change_time = new Date()

    _connect: (cb) =>
