 
     it "repeats correctly", ->
       keydown 'a'
-      editor.setText("abc")
+      editor.insertText("abc")
       keydown 'escape'
       expect(editor.getText()).toBe "abc"
       keydown '.'


    it "allows undoing an entire batch of typing", ->
      keydown 'i'
      editor.setText("abc")
      keydown 'escape'
      keydown 'i'
      editor.setText("abcdef")
      keydown 'escape'
      expect(editor.getText()).toBe "abcdef"
      keydown 'u'
      expect(editor.getText()).toBe "abc"
      keydown 'u'


    it "allows repeating typing", ->
      keydown 'i'
      editor.insertText("abc")
      keydown 'escape'
      keydown '.'
      editor.insertText("ababcc")

    # This one doesn't work because we can't simulate typing correctly,
    # and VimState#resetInputTransactions actually inspects buffer patches to
    # build patches for repeating
    xit "resets transactions for repeats after movement", ->
      editor.setCursorBufferPosition([0, 0])
      editor.insertText("abc\n123")
      keydown 'i'
      editor.insertText("def")
      editorView.trigger 'core:move-down'
      expect(editor.getCursorBufferPosition()).toEqual [1, 3]
      editor.insertText("456")
      keydown 'escape'
      editor.setCursorBufferPosition([0, 0])
      keydown '.'
