       return                    # nothing to do
 
     # if they have two styles that differ
-    keys = _.keys(@style)
-    for key in keys
-      if not(_.has(selection.style, key))
-        return
-    selection.setStyle @style
+    if not (_.isEqual(@style, selection.style))
+      return
 
     selToRemove = @
     selToKeep = selection

  isValid: ->
    @lt(@right, @rightPos, "left")


  # Try to merge the given selection with this selection, keeping this selection
  #

    @right = null

  # Bind selection to word
  # @param [Word] left a word instance to bind at left
  # @param [Word] right a word instance to bind at right
  # @note could be optimized
  bind: (left, right) ->
    if !left
      throw new Error "Missing argument left"
    if !right
      throw new Error "Missing argument right"
    if !(@ in @left.left)
      @left.left.push @
    if !(@ in @right.right)
      @right.right.push @

  # Clone the current selection and apply style
  # @parameter [String] style the new style
