 
       describe "when there is a selection", ->
         beforeEach ->
-          editor.setSelectedBufferRange([[5, 22],[5, 27]])
+          editor.setSelectedBufferRange([[5, 22], [5, 27]])
 
         it "moves to the left of the selection", ->
           cursor = editor.getLastCursor()


      describe "when counts are passed into the selection functions", ->
        it "expands each selection to its cursor's new location", ->
          editor.setSelectedBufferRanges([[[0,9], [0,13]], [[3,16], [3,21]]])
          [selection1, selection2] = editor.getSelections()

          editor.selectRight(2)
          expect(selection1.getBufferRange()).toEqual [[0,9], [0,15]]
          expect(selection2.getBufferRange()).toEqual [[3,16], [3,23]]

          editor.selectLeft(3)
          expect(selection1.getBufferRange()).toEqual [[0,9], [0,12]]
          expect(selection2.getBufferRange()).toEqual [[3,16], [3,20]]

          editor.selectDown(3)
          expect(selection1.getBufferRange()).toEqual [[0,9], [3,12]]
          expect(selection2.getBufferRange()).toEqual [[3,16], [6,20]]

          editor.selectUp(2)
          expect(selection1.getBufferRange()).toEqual [[0,9], [1,12]]
          expect(selection2.getBufferRange()).toEqual [[3,16], [4,20]]

    describe ".selectToBufferPosition(bufferPosition)", ->
      it "expands the last selection to the given position", ->


    describe ".selectToBeginningOfWord()", ->
      it "selects text from cusor position to beginning of word", ->
        editor.setCursorScreenPosition [0, 13]
        editor.addCursorAtScreenPosition [3, 49]

        editor.selectToBeginningOfWord()

        expect(editor.getCursors().length).toBe 2
        [cursor1, cursor2] = editor.getCursors()
        expect(cursor1.getBufferPosition()).toEqual [0, 4]
        expect(cursor2.getBufferPosition()).toEqual [3, 47]

        expect(editor.getSelections().length).toBe 2
        [selection1, selection2] = editor.getSelections()
        expect(selection1.getBufferRange()).toEqual [[0, 4], [0, 13]]
        expect(selection1.isReversed()).toBeTruthy()
        expect(selection2.getBufferRange()).toEqual [[3, 47], [3, 49]]
        expect(selection2.isReversed()).toBeTruthy()

    describe ".selectToEndOfWord()", ->
      it "selects text from cusor position to end of word", ->
        editor.setCursorScreenPosition [0, 4]
        editor.addCursorAtScreenPosition [3, 48]

        editor.selectToEndOfWord()

        expect(editor.getCursors().length).toBe 2
        [cursor1, cursor2] = editor.getCursors()
        expect(cursor1.getBufferPosition()).toEqual [0, 13]
        expect(cursor2.getBufferPosition()).toEqual [3, 50]

        expect(editor.getSelections().length).toBe 2
        [selection1, selection2] = editor.getSelections()
        expect(selection1.getBufferRange()).toEqual [[0, 4], [0, 13]]
        expect(selection1.isReversed()).toBeFalsy()
        expect(selection2.getBufferRange()).toEqual [[3, 48], [3, 50]]
        expect(selection2.isReversed()).toBeFalsy()

    describe ".selectToBeginningOfNextWord()", ->
      it "selects text from cusor position to beginning of next word", ->
        editor.setCursorScreenPosition [0, 4]
        editor.addCursorAtScreenPosition [3, 48]

        editor.selectToBeginningOfNextWord()

        expect(editor.getCursors().length).toBe 2
        [cursor1, cursor2] = editor.getCursors()
        expect(cursor1.getBufferPosition()).toEqual [0, 14]
        expect(cursor2.getBufferPosition()).toEqual [3, 51]

        expect(editor.getSelections().length).toBe 2
        [selection1, selection2] = editor.getSelections()
        expect(selection1.getBufferRange()).toEqual [[0, 4], [0, 14]]
        expect(selection1.isReversed()).toBeFalsy()
        expect(selection2.getBufferRange()).toEqual [[3, 48], [3, 51]]
        expect(selection2.isReversed()).toBeFalsy()

    describe ".selectToPreviousWordBoundary()", ->
