   #   @param [Function] fun the function to use for filtering
   #   @return [Array<Selection>] an array of selection
   getSelections: (filter = null)->
+    # console.log "Word.getSelections", @left, @right
     tmp = (if _.isFunction(filter)
-             @left.filter(filter).concat(@right.filter(filter)) or []
+             @left.concat(@right).filter(filter) or []
            else
              @left.concat(@right) or [])
-    # filter to get an array with unique values (a.k.a) they
-    # have a unique index in the array
-    tmp.filter (el, index, array)->
-      (array.indexOf el) == index
+    # console.log "returning", _.uniq tmp
+    _.uniq tmp
 
 
 

  merge: (index) ->
    if 0 <= index < @getWords(0).length
      word = @getWord index
      [selLeft, selRight] = [word.left, word.right]
      for selection in selLeft when (selection and selection.left and selection.right)
        selection.unbind()
        @removeSel selection
      for selection in selRight when (selection and selection.left and selection.right)
        selection.unbind()
        @removeSel selection
      word.left = word.right = []
      console.log selLeft
      # remove word at position index
      @deleteWords index
      # insert its content at position where is used to be
      pos = absoluteFromRelative index, 0, @
      console.log selLeft
      @insert pos, word.word.trimRight()
      console.log selLeft

      # the new word is here
      newWord = @getWord index

      for selection in selLeft
        selection.left = newWord
        selection.bind selection.left, selection.right
        @pushSel selection

      for selection in selRight
        selection.right = newWord
        selection.bind selection.left, selection.right
        @pushSel selection
    else
      throw new Error "Impossible to merge"

      if not (sel.atLeftOf thisSel)
        tmpSelections.push sel
        continue
      # console.log sel.print()+" at left of "+thisSel.print()
      [left, right] = sel.unbind()
      sel.rightPos = 0
      sel.bind left, wordToBound
