diff --git a/package.json b/package.json index f886200d9..f43f78c90 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "temp": "0.7.0", "text-buffer": "^2.4.2", "theorist": "^1", - "underscore-plus": "^1.4.1", + "underscore-plus": "^1.5.0", "vm-compatibility-layer": "0.1.0" }, "packageDependencies": { diff --git a/src/gutter-component.coffee b/src/gutter-component.coffee index 5fc1a1730..ed83a63d4 100644 --- a/src/gutter-component.coffee +++ b/src/gutter-component.coffee @@ -174,11 +174,11 @@ GutterComponent = React.createClass if previousDecorations? for decoration in previousDecorations - node.classList.remove(decoration.class) if editor.decorationMatchesType(decoration, 'gutter') and not contains(decorations, decoration) + node.classList.remove(decoration.class) if editor.decorationMatchesType(decoration, 'gutter') and not _.deepContains(decorations, decoration) if decorations? for decoration in decorations - if editor.decorationMatchesType(decoration, 'gutter') and not contains(previousDecorations, decoration) + if editor.decorationMatchesType(decoration, 'gutter') and not _.deepContains(previousDecorations, decoration) node.classList.add(decoration.class) unless @screenRowsByLineNumberId[lineNumberId] is screenRow @@ -211,10 +211,3 @@ GutterComponent = React.createClass unless width is @measuredWidth @measuredWidth = width @props.onWidthChanged?(width) - -# Created because underscore uses === not _.isEqual, which we need -contains = (array, target) -> - return false unless array? - for object in array - return true if _.isEqual(object, target) - false diff --git a/src/lines-component.coffee b/src/lines-component.coffee index d359306ed..4e016b601 100644 --- a/src/lines-component.coffee +++ b/src/lines-component.coffee @@ -215,11 +215,11 @@ LinesComponent = React.createClass if previousDecorations = @renderedDecorationsByLineId[line.id] for decoration in previousDecorations - lineNode.classList.remove(decoration.class) if editor.decorationMatchesType(decoration, 'line') and not contains(decorations, decoration) + lineNode.classList.remove(decoration.class) if editor.decorationMatchesType(decoration, 'line') and not _.deepContains(decorations, decoration) if decorations = lineDecorations[screenRow] for decoration in decorations - if editor.decorationMatchesType(decoration, 'line') and not contains(previousDecorations, decoration) + if editor.decorationMatchesType(decoration, 'line') and not _.deepContains(previousDecorations, decoration) lineNode.classList.add(decoration.class) return @@ -292,10 +292,3 @@ LinesComponent = React.createClass clearScopedCharWidths: -> @measuredLines.clear() @props.editor.clearScopedCharWidths() - -# Created because underscore uses === not _.isEqual, which we need -contains = (array, target) -> - return false unless array? - for object in array - return true if _.isEqual(object, target) - false