           indentLevel: line.indentLevel
           tabLength: line.tabLength
           fold: line.fold
-          decorationClasses: @lineDecorationClassesForRow(row)
-      row++
+          decorationClasses: @lineDecorationClassesForRow(screenRow)
 
     for id, line of tileState.lines
       delete tileState.lines[id] unless visibleLineIds.hasOwnProperty(id)

      isVisible = isVisible and @showLineNumbers
    isVisible

  updateLineNumbersState: (tileState, startRow, endRow) ->
    tileState.lineNumbers ?= {}
    visibleLineNumberIds = {}

    if startRow > 0
      rowBeforeStartRow = startRow - 1
      lastBufferRow = @model.bufferRowForScreenRow(rowBeforeStartRow)
    else
      lastBufferRow = null

    if endRow > startRow
      bufferRows = @model.bufferRowsForScreenRows(startRow, endRow - 1)
      for bufferRow, i in bufferRows
        if bufferRow is lastBufferRow
          softWrapped = true
        else
          lastBufferRow = bufferRow
          softWrapped = false

        screenRow = startRow + i
        decorationClasses = @lineNumberDecorationClassesForRow(screenRow)
        foldable = @model.isFoldableAtScreenRow(screenRow)
        id = @model.tokenizedLineForScreenRow(screenRow).id

        tileState.lineNumbers[id] = {screenRow, bufferRow, softWrapped, top, decorationClasses, foldable}
        visibleLineNumberIds[id] = true

    for id of tileState.lineNumbers
      delete tileState.lineNumbers[id] unless visibleLineNumberIds[id]

      gutterTile.display = "block"
      gutterTile.zIndex = zIndex

      @updateLinesState(tile, rowsWithinTile) if @shouldUpdateLinesState
      @updateLineNumbersState(gutterTile, rowsWithinTile) if @shouldUpdateLineNumbersState

      visibleTiles[tileStartRow] = true
      zIndex++
