 
   describe "gutter rendering", ->
     [gutter] = []
-
-    lineNumberHasClass = (screenRow, klass) ->
-      component.lineNumberNodeForScreenRow(screenRow).classList.contains(klass)
-
-    lineNumberForBufferRowHasClass = (bufferRow, klass) ->
-      screenRow = editor.displayBuffer.screenRowForBufferRow(bufferRow)
-      component.lineNumberNodeForScreenRow(screenRow).classList.contains(klass)
 
     beforeEach ->
       {gutter} = component.refs

    describe "when line decorations are attached to markers", ->
      {marker, decoration} = {}

      lineHasClass = (screenRow, klass) ->
        component.lineNodeForScreenRow(screenRow).classList.contains(klass)

      beforeEach ->
        marker = editor.displayBuffer.markBufferRange([[2, 13], [3, 15]], invalidate: 'inside')
        decoration = {type: 'line', class: 'someclass'}

      runSetImmediateCallbacks()
      expect(node.querySelector('.line').textContent).toBe "var quicksort "

  describe "default decorations", ->
    it "applies .cursor-line decorations to lines and line numbers for rows containing the cursor", ->
      editor.setCursorScreenPosition([4, 4])
      runSetImmediateCallbacks()
      expect(lineNumberHasClass(3, 'cursor-line')).toBe false
      expect(lineNumberHasClass(4, 'cursor-line')).toBe true
      expect(lineNumberHasClass(5, 'cursor-line')).toBe false
      expect(lineHasClass(3, 'cursor-line')).toBe false
      expect(lineHasClass(4, 'cursor-line')).toBe true
      expect(lineHasClass(5, 'cursor-line')).toBe false

      editor.setSelectedScreenRange([[3, 4], [4, 4]])
      runSetImmediateCallbacks()
      expect(lineNumberHasClass(4, 'cursor-line')).toBe true
      expect(lineHasClass(4, 'cursor-line')).toBe true

    it "applies .selection-line decorations to lines and line numbers for rows spanned by non-empty selections", ->
      editor.setCursorScreenPosition([4, 4])
      runSetImmediateCallbacks()
      expect(lineNumberHasClass(4, 'selection-line')).toBe false
      expect(lineHasClass(4, 'selection-line')).toBe false

      editor.setSelectedScreenRange([[4, 4], [6, 4]])
      runSetImmediateCallbacks()
      expect(lineNumberHasClass(3, 'selection-line')).toBe false
      expect(lineNumberHasClass(4, 'selection-line')).toBe true
      expect(lineNumberHasClass(5, 'selection-line')).toBe true
      expect(lineNumberHasClass(6, 'selection-line')).toBe true
      expect(lineNumberHasClass(7, 'selection-line')).toBe false
      expect(lineHasClass(3, 'selection-line')).toBe false
      expect(lineHasClass(4, 'selection-line')).toBe true
      expect(lineHasClass(5, 'selection-line')).toBe true
      expect(lineHasClass(6, 'selection-line')).toBe true
      expect(lineHasClass(7, 'selection-line')).toBe false

    it "applies .cursor-line-no-selection to line numbers for rows containing the cursor when the selection is empty", ->
      editor.setCursorScreenPosition([4, 4])
      runSetImmediateCallbacks()
      expect(lineNumberHasClass(4, 'cursor-line-no-selection')).toBe true

      editor.setSelectedScreenRange([[3, 4], [4, 4]])
      runSetImmediateCallbacks()
      expect(lineNumberHasClass(4, 'cursor-line-no-selection')).toBe false

  describe "legacy editor compatibility", ->
    it "triggers the screen-lines-changed event before the editor:display-update event", ->
      editor.setSoftWrap(true)
