   #   Delete the word at position
   #
   #   @param [Integer] position position the word to delete
+  #
+  # @note selections that where bound to any of the deleted word
+  # are moved to the beginning of the first word not deleted
   deleteWords: (start, end) ->
     if _.isUndefined(end)
       end = start+1

  removeSel: (selection) ->
    index = 0
    array = @_rte.selections
    for index in [0..array.length-1]
      if (array[index] == selection)
        array.splice index, 1
        break

  # Only for manual use, so no efficiency research
  garbageCollect: ->
    sels = @_rte.selections
    for sel, index in sels
      for key, value of sel
        if value == null or value == ""
          sel.unbind()
          @removeSel sel


if window?
