             ]}
           @editor.setContents delta
 
-          # propagate new string
         when "selections"
           selectionStart = @characters.indexOf (event.object.left or event.oldValue.left)
           selectionEnd = @characters.indexOf (event.object.right or event.oldValue.right)

      sels = @selections._getModel(Y, Operation)
      chars = @characters._getModel(Y, Operation)
      cursors = new Operation.ListManager(@).execute()
      cursors.insert 0, @_cursors

      @_model = new Operation.MapManager(@).execute()
      @_model.val "selections", sels

Characters = require 'characters'
Selections = require '../../y-selections'

# A class holding the information about rich text
class RichText
  # @param content [String] an initial string
  # @param editor [Editor] an editor instance
  # @param author [String] the name of the local author
  constructor: (content, editor, author) ->
    # TODO: generate a UID
    @selections = new Selections
    @characters = new Characters content, @selections

    @author = author

    @editor = editor
    # shouldn't go there
    @editor.cursors = @editor.getModule("multi-cursor")

  _getModel: (Y, Operation) ->
