       when 'below' then @editor.insertNewlineBelow()
     @editor.getLastCursor().skipLeadingWhitespace()
 
-    if @typedText?
+    if @insertedText?
       # We'll have captured the inserted newline, but we want to do that
       # over again by hand, or differing indentations will be wrong.
-      @typedText = @typedText.trimLeft()
+      @insertedText = @insertedText.trimLeft()
       super
     else
       @vimState.activate('insert')


  confirmChanges: (checkpoint) ->
    changes = @getChangesSinceCheckpoint(checkpoint)
    @typedText = if (range = getInsertedRange(changes))?
      @editor.getTextInBufferRange(range)
    else
      ""

  execute: ->
    if @typedText?
      return unless @typedText
      @editor.insertText(@typedText, normalizeLineEndings: true, autoIndent: true)
      for cursor in @editor.getCursors() when not cursor.isAtBeginningOfLine()
        cursor.moveLeft()
    else

  @extend()

  execute: ->
    if @insertedText?
      return unless @insertedText
      @editor.transact =>
        @editor.insertText(@insertedText, normalizeLineEndings: true)
        toDelete = @insertedText.length - @countChars('\n', @insertedText)
        for selection in @editor.getSelections()
          count = toDelete
          selection.delete() while count-- and not selection.cursor.isAtEndOfLine()
