 
         keydown('d', element: editor[0])
         keydown('d', element: editor[0])
+
         expect(editor.getText()).toBe "12345\n\nABCDE"
         expect(editor.getCursorScreenPosition()).toEqual([1,0])
         expect(vimState.getRegister('"').text).toBe "abcde\n"

      it "deletes the last line", ->
        editor.setText("12345\nabcde\nABCDE")
        editor.setCursorScreenPosition([2,1])
        keydown('d', element: editor[0])
        keydown('d', element: editor[0])
        expect(editor.getText()).toBe "12345\nabcde"
        expect(editor.getCursorScreenPosition()).toEqual([1,0])

      describe "when the second d is prefixed by a count", ->
        beforeEach ->
          editor.setText("12345\nabcde\nABCDE\nQWERT")
          editor.setCursorScreenPosition([1,1])

          keydown('d', element: editor[0])
          keydown('2', element: editor[0])
          keydown('d', element: editor[0])

        it "deletes n lines, starting from the current", ->
          expect(editor.getText()).toBe "12345\nQWERT"
          expect(editor.getCursorScreenPosition()).toEqual([1,0])

        describe "with undo", ->
          beforeEach ->
            keydown('u', element: editor[0])

          it "undoes both lines", ->
            expect(editor.getText()).toBe "12345\nabcde\nABCDE\nQWERT"

    describe "when followed by an h", ->
      it "deletes the previous letter on the current line", ->

      expect(editor.getText()).toBe "012345\n\nabcdef"

  describe "the s keybinding", ->
    beforeEach ->
      editor.setText("012345")
      editor.setCursorScreenPosition([0, 1])

    it "deletes the character to the right and enters insert mode", ->
      keydown('s', element: editor[0])

      expect(editor).toHaveClass 'insert-mode'
      expect(editor.getText()).toBe '02345'
      expect(editor.getCursorScreenPosition()).toEqual [0, 1]
      expect(vimState.getRegister('"').text).toBe '1'

    it "deletes count characters to the right and enters insert mode", ->
      keydown('3', element: editor[0])
      keydown('s', element: editor[0])

      expect(editor).toHaveClass 'insert-mode'
      expect(editor.getText()).toBe '045'
      expect(editor.getCursorScreenPosition()).toEqual [0, 1]
