     @div class: 'gutter', =>
       @div outlet: 'lineNumbers', class: 'line-numbers'
 
-  firstScreenRow: Infinity
-  lastScreenRow: -1
+  firstScreenRow: null
+  lastScreenRow: null
+
+  initialize: ->
+    @elementBuilder = document.createElement('div')
 
   afterAttach: (onDom) ->
     return if @attached or not onDom


  ### Internal ###

  updateLineNumbers: (changes, renderFrom, renderTo) ->
    if renderFrom < @firstScreenRow or renderTo > @lastScreenRow
      performUpdate = true
    else if @getEditor().getLastScreenRow() < @lastScreenRow
      performUpdate = true
    else
      for change in changes
        if change.screenDelta or change.bufferDelta
          performUpdate = true
          break

    @renderLineNumbers(renderFrom, renderTo) if performUpdate

  renderLineNumbers: (startScreenRow, endScreenRow) ->
    @lineNumbers[0].innerHTML = @buildLineElementsHtml(startScreenRow, endScreenRow)
    @firstScreenRow = startScreenRow
    @lastScreenRow = endScreenRow
    @highlightedRows = null
    @highlightLines()

  buildLineElementsHtml: (startScreenRow, endScreenRow) =>
    editor = @getEditor()

  #
  # Returns a list of {HTMLElement}s.
  getLineNumberElements: ->
    @lineNumbers[0].children

  # Get all the line-number divs.
  #
