     for screenRow in screenRows
       line = @model.tokenizedLineForScreenRow(screenRow)
       unless line?
-        throw new Error("No line exists for row #{row}. Last screen row: #{@model.getLastScreenRow()}")
+        throw new Error("No line exists for row #{screenRow}. Last screen row: #{@model.getLastScreenRow()}")
 
       visibleLineIds[line.id] = true
       if tileState.lines.hasOwnProperty(line.id)

  getState: ->
    @updating = true

    @updateVerticalDimensions()
    @updateScrollbarDimensions()
    @updateStartRow()
    @updateEndRow()
    @updateCommonGutterState()
    @updateHorizontalDimensions()
    @updateReflowState()

    [startRow...endRow]

  updateVisibleTilesState: ->
    @updateTilesState(@getVisibleRows())

  deleteTemporaryTiles: ->
    for tileId, tileState of @state.content.tiles when tileState.temporary
      delete @state.content.tiles[tileId]
      delete @lineNumberGutter.tiles[tileId]

  updateTilesState: (screenRows, temporary = false) ->
    return unless @startRow? and @endRow? and @lineHeight?

    screenRows.sort (a, b) -> a - b

    visibleTiles = {}
