     atom.config.set('editor.preferredLineLength', softWrapColumn)
 
   it "properly renders soft-wrapped lines when randomly mutated", ->
-    previousSteps = JSON.parse(localStorage.steps ? '[]')
-
     times 10, (i) ->
       buffer = new TextBuffer
       editor = new TextEditor({buffer})

    text

  getReferenceScreenLines = ->
    if editor.isSoftWrapped()
      screenLines = []
      bufferRows = []
      for bufferRow in [0..tokenizedBuffer.getLastRow()]
        for screenLine in softWrapLine(tokenizedBuffer.tokenizedLineForRow(bufferRow))
          screenLines.push(screenLine)
          bufferRows.push(bufferRow)
    else
      screenLines = tokenizedBuffer.tokenizedLines.slice()
      bufferRows = [0..tokenizedBuffer.getLastRow()]
    {screenLines, bufferRows}

  softWrapLine = (tokenizedLine) ->
    wrappedLines = []
    while tokenizedLine.text.length > softWrapColumn and wrapScreenColumn = findWrapColumn(tokenizedLine.text)
      [wrappedLine, tokenizedLine] = tokenizedLine.softWrapAt(wrapScreenColumn)
      wrappedLines.push(wrappedLine)
    wrappedLines.push(tokenizedLine)
    wrappedLines

  findWrapColumn = (line) ->
    if /\s/.test(line[softWrapColumn])
      # search forward for the start of a word past the boundary
      for column in [softWrapColumn..line.length]
        return column if /\S/.test(line[column])
      return line.length
    else
      # search backward for the start of the word on the boundary
      for column in [softWrapColumn..0]
        return column + 1 if /\s/.test(line[column])
      return softWrapColumn

TextEditor = require '../src/text-editor'

describe "TextEditor", ->
  [editor, tokenizedBuffer, buffer, steps] = []

  softWrapColumn = 80

