       it "positions the cursor to the clicked row and column", ->
           {top, left} = editorView.pixelOffsetForScreenPosition([3, 30])
           editorView.renderedLines.trigger mousedownEvent(pageX: left, pageY: top)
-          expect(editorView.getCursorScreenPosition()).toEqual [3, 30]
+          expect(editor.getCursorScreenPosition()).toEqual [3, 30]
 
     describe "double-click", ->
       it "selects the word under the cursor, and expands the selection wordwise in either direction on a subsequent shift-click", ->
-        expect(editorView.getCursorScreenPosition()).toEqual(row: 0, column: 0)
+        expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)
         editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [8, 24], originalEvent: {detail: 1})
         editorView.renderedLines.trigger 'mouseup'
         editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [8, 24], originalEvent: {detail: 2})
         editorView.renderedLines.trigger 'mouseup'
-        expect(editorView.getSelectedText()).toBe "concat"
+        expect(editor.getSelectedText()).toBe "concat"
 
         editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [8, 7], shiftKey: true)
         editorView.renderedLines.trigger 'mouseup'
 
-        expect(editorView.getSelectedText()).toBe "return sort(left).concat"
+        expect(editor.getSelectedText()).toBe "return sort(left).concat"
 
       it "stops selecting by word when the selection is emptied", ->
-        expect(editorView.getCursorScreenPosition()).toEqual(row: 0, column: 0)
+        expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)
         editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 8], originalEvent: {detail: 1})
         editorView.renderedLines.trigger 'mouseup'
         editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 8], originalEvent: {detail: 2})
         editorView.renderedLines.trigger 'mouseup'
-        expect(editorView.getSelectedText()).toBe "quicksort"
+        expect(editor.getSelectedText()).toBe "quicksort"
 
         editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [3, 10])
         editorView.renderedLines.trigger 'mouseup'
 
         editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [3, 12], originalEvent: {detail: 1}, shiftKey: true)
-        expect(editorView.getSelectedBufferRange()).toEqual [[3, 10], [3, 12]]
+        expect(editor.getSelectedBufferRange()).toEqual [[3, 10], [3, 12]]
 
       describe "when clicking between a word and a non-word", ->
         it "selects the word", ->
-          expect(editorView.getCursorScreenPosition()).toEqual(row: 0, column: 0)
+          expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)
           editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [1, 21], originalEvent: {detail: 1})
           editorView.renderedLines.trigger 'mouseup'
           editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [1, 21], originalEvent: {detail: 2})
           editorView.renderedLines.trigger 'mouseup'
-          expect(editorView.getSelectedText()).toBe "function"
-
-          editorView.setCursorBufferPosition([0, 0])
+          expect(editor.getSelectedText()).toBe "function"
+
+          editor.setCursorBufferPosition([0, 0])
           editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [1, 22], originalEvent: {detail: 1})
           editorView.renderedLines.trigger 'mouseup'
           editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [1, 22], originalEvent: {detail: 2})
           editorView.renderedLines.trigger 'mouseup'
-          expect(editorView.getSelectedText()).toBe "items"
-
-          editorView.setCursorBufferPosition([0, 0])
+          expect(editor.getSelectedText()).toBe "items"
+
+          editor.setCursorBufferPosition([0, 0])
           editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 28], originalEvent: {detail: 1})
           editorView.renderedLines.trigger 'mouseup'
           editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [0, 28], originalEvent: {detail: 2})
           editorView.renderedLines.trigger 'mouseup'
-          expect(editorView.getSelectedText()).toBe "{"
+          expect(editor.getSelectedText()).toBe "{"
 
     describe "triple/quardruple/etc-click", ->
       it "selects the line under the cursor", ->
-        expect(editorView.getCursorScreenPosition()).toEqual(row: 0, column: 0)
+        expect(editor.getCursorScreenPosition()).toEqual(row: 0, column: 0)
 
         # Triple click
         editorView.renderedLines.trigger mousedownEvent(editorView: editorView, point: [1, 8], originalEvent: {detail: 1})

          expect(editorView.renderedLines.find('.line:eq(10) .indent-guide').length).toBe 1
          expect(editorView.renderedLines.find('.line:eq(10) .indent-guide').text()).toBe '  '

          editorView.setCursorBufferPosition([9])
          editorView.indentSelectedRows()

          expect(editorView.renderedLines.find('.line:eq(10) .indent-guide').length).toBe 2
          expect(editorView.renderedLines.find('.line:eq(10) .indent-guide').text()).toBe '    '

              editorView.width(charWidth * 30)

              # moving right
              editor.setCursorScreenPosition([2, 24])
              expect(editorView.scrollLeft()).toBe 0

              editor.setCursorScreenPosition([2, 25])
              expect(editorView.scrollLeft()).toBe 0

              editor.setCursorScreenPosition([2, 28])
              expect(editorView.scrollLeft()).toBe 0

              # moving left
              editor.setCursorScreenPosition([2, 9])
              expect(editorView.scrollLeft()).toBe 0

              editor.setCursorScreenPosition([2, 8])
              expect(editorView.scrollLeft()).toBe 0

              editor.setCursorScreenPosition([2, 5])
              expect(editorView.scrollLeft()).toBe 0

  describe "when editor:toggle-soft-wrap is toggled", ->
