         backend range.start
         console.log range.start
 
-  updateContents: (delta) ->
+  updateContents: (delta) -> locker @, delta, (delta) =>
     @editor.updateContents delta
 
 exports.QuillJs = QuillJs

  getContents: ()->
    @editor.getContents()

  setCursor: (param) ->
    @_cursors.setCursor param.id, param.index, param.text, param.color

  observeLocalText: (backend) ->
    @editor.on "text-change", (deltas, source) ->
      # call the backend with deltas
      backend deltas
      console.log deltas

  observeLocalCursor: (backend) ->
    @editor.on "selection-change", (range, source) ->
      if source == 'api'
        # only when there's a cursor (range start === range end)

locker = (require "./misc.coffee").locker
# a generic editor class
class Editor
  # create an editor instance
