 
       editor.insertText("def\n")
       expect(editor.lineElementForScreenRow(0).text()).toBe 'def'
-
-    it "removes the opened session from the closed sessions array", ->
-      editor.edit(project.buildEditSession('sample.txt'))
-      expect(editor.closedEditSessions.length).toBe 0
-      editor.trigger "core:close"
-      expect(editor.closedEditSessions.length).toBe 1
-      editor.edit(project.buildEditSession('sample.txt'))
-      expect(editor.closedEditSessions.length).toBe 0
 
   describe "switching edit sessions", ->
     [session0, session1, session2] = []


    describe "when line has a character that could push it to be too tall (regression)", ->
      it "does renders the line at a consistent height", ->
        rootView.attachToDom()
        buffer.insert([0, 0], "–")
        expect(editor.find('.line:eq(0)').outerHeight()).toBe editor.find('.line:eq(1)').outerHeight()


describe "Editor", ->
  [buffer, editor, cachedLineHeight] = []

  beforeEach ->
    editor = new Editor(project.buildEditSession('sample.js'))
    buffer = editor.getBuffer()
    editor.lineOverdraw = 2
    editor.isFocused = true
    editor.enableKeymap()
    editor.attachToDom = ({ heightInLines, widthInChars } = {}) ->
      heightInLines ?= this.getBuffer().getLineCount()
      this.height(getLineHeight() * heightInLines)
      this.width(@charWidth * widthInChars) if widthInChars
      $('#jasmine-content').append(this)


  getLineHeight = ->
    return cachedLineHeight if cachedLineHeight?
    editorForMeasurement = new Editor(editSession: project.buildEditSession('sample.js'))
