         unless oldDecorationClasses? and decorationClass in oldDecorationClasses
           lineNode.classList.add(decorationClass)
 
-    lineNode.style.width = scrollWidth + 'px'
-    lineNode.style.top = top + 'px'
-    lineNode.dataset.screenRow = screenRow
-    @screenRowsByLineId[id] = screenRow
-    @lineIdsByScreenRow[screenRow] = id
+    oldLineState.decorationClasses = newLineState.decorationClasses
+
+    if newLineState.top isnt oldLineState.top
+      lineNode.style.top = newLineState.top + 'px'
+      oldLineState.top = newLineState.cop
+
+    if newLineState.screenRow isnt oldLineState.screenRow
+      lineNode.dataset.screenRow = newLineState.screenRow
+      oldLineState.screenRow = newLineState.screenRow
+      @lineIdsByScreenRow[newLineState.screenRow] = id
 
   lineNodeForScreenRow: (screenRow) ->
     @lineNodesByLineId[@lineIdsByScreenRow[screenRow]]


    @removeLineNodes() unless @oldState.indentGuidesVisible is @newState.indentGuidesVisible
    @updateLineNodes()
    @measureCharactersInNewLines() if visible and not @newState.scrollingVertically

    @cursorsComponent.updateSync()

    "<span class=\"#{scope.replace(/\.+/g, ' ')}\">"

  updateLineNode: (id) ->
    oldLineState = @oldState.lines[id]
    newLineState = @newState.lines[id]

    lineNode = @lineNodesByLineId[id]

    if @newState.scrollWidth isnt @oldState.scrollWidth
      lineNode.style.width = @newState.scrollWidth + 'px'

    newDecorationClasses = newLineState.decorationClasses
    oldDecorationClasses = oldLineState.decorationClasses

    if oldDecorationClasses?
      for decorationClass in oldDecorationClasses
