           {retain: selection_length, attributes: attrs}
         ]
 
-      this.lock_editor_propagation = false
-
     # update the editor when the cursor is moved
-    @_get("cursors").observe (events)=>
-      if this.lock_editor_propagation
-        # break, if lock is on
-        return
-      this.lock_editor_propagation = true
-
+    @_get("cursors").observe (events) => locker @, events, (events) =>
       for event in events
         author = event.changedBy
         position = event.object.val(author)

          delta.ops.push {delete: 1}

        @editor.updateContents delta
      this.lock_editor_propagation = false

    # update the editor when something on the $selections happens
    @_get("selections").observe (event)=>
      if this.lock_editor_propagation
        # break, if lock is on
        return
      this.lock_editor_propagation = true

      attrs = {}
      if event.type is "select"
        for attr,val of event.attrs

  #   update the position of our cursor to the new one using a character
  #   @param character [Character] the new character
  updateCursorPosition : (obj) =>
    locker @, obj, (obj) =>
      if typeof obj == "number"
        @selfCursor = (@_get "characters").ref(obj)
      else
        @selfCursor = obj
      (@_get "cursors").val(@_model.HB.getUserId(), @selfCursor)

  # describe how to propagate yjs events to the editor
  # TODO: should be private!
  bindEventsToEditor : (editor) ->
    # update the editor when something on the $characters happens
    @_get("characters").observe (events) => locker @, events, (events) =>
      for event in events
        delta =
          ops: [{retain: event.position}]
