         }
 
         line2 = editor.tokenizedLineForScreenRow(2)
-        expectValues presenter.state.content.lines[line2.id], {
+        expectValues lineStateForScreenRow(presenter, 2), {
           screenRow: 2
           text: line2.text
           tokens: line2.tokens

        presenter.setScrollTop(25)

        line0 = editor.tokenizedLineForScreenRow(0)
        expect(presenter.state.content.lines[line0.id]).toBeUndefined()

        line1 = editor.tokenizedLineForScreenRow(1)
        expectValues presenter.state.content.lines[line1.id], {
          screenRow: 1
          text: line1.text
          tokens: line1.tokens

          expect(presenter.state.content.indentGuidesVisible).toBe false

  describe "::state.content.lines", ->
    lineStateForScreenRow = (presenter, screenRow) ->
      presenter.state.content.lines[presenter.model.tokenizedLineForScreenRow(screenRow).id]

    describe "on initialization", ->
      it "contains the lines that are visible on screen, plus the overdraw margin", ->
        presenter = new TextEditorPresenter(model: editor, clientHeight: 25, scrollTop: 0, lineHeight: 10, lineOverdrawMargin: 1)

        line0 = editor.tokenizedLineForScreenRow(0)
        expectValues lineStateForScreenRow(presenter, 0), {
          screenRow: 0
          text: line0.text
          tokens: line0.tokens
