   insertNewline: ->
     @editor.insertNewlineAbove()
 
-  insertText: (selection, text) ->
+  repeatInsert: (selection, text) ->
     selection.insertText(text.trimLeft(), autoIndent: true)
 
 class InsertBelowWithNewline extends InsertAboveWithNewline


  constructor: ->
    super
    @setTarget @new(@target) if @target?
    #  To support, `dd`, `cc` and a like.
    if @isSameOperatorRepeated()

    {text, type} = @vimState.register.get()
    return unless text
    text = _.multiplyString(text, @getCount())
    isLinewise = type is 'linewise' or @vimState.isMode('visual', 'linewise')

    @editor.transact =>
      for s in @editor.getSelections()
        {cursor} = s
        if isLinewise
          newRange = @pasteLinewise(s, text)
          cursor.setBufferPosition(newRange.start)
          cursor.moveToFirstCharacterOfLine()
        else
          newRange = @pasteCharacterwise(s, text)
          cursor.setBufferPosition(newRange.end.translate([0, -1]))
        @setMarkForChange(newRange)
        @flash newRange
    @activate('normal')

  # Return newRange
  pasteLinewise: (selection, text) ->
    {cursor} = selection
    if selection.isEmpty()
      text = text.replace(/\n$/, '')
      if @location is 'before'
        @insertTextAbove(selection, text)
      else
        @insertTextBelow(selection, text)
    else
      if @vimState.isMode('visual', 'linewise')
        text += '\n' unless text.endsWith('\n')
      else
        selection.insertText("\n")
      selection.insertText(text)

  pasteCharacterwise: (selection, text) ->
    if @location is 'after' and selection.isEmpty()
      selection.cursor.moveRight()
    selection.insertText(text)

  insertTextAbove: (selection, text) ->
    selection.cursor.moveToBeginningOfLine()
    selection.insertText("\n")
    selection.cursor.moveUp()
    selection.insertText(text)

  insertTextBelow: (selection, text) ->
    selection.cursor.moveToEndOfLine()
    selection.insertText("\n")
    selection.insertText(text)

class PutAfter extends PutBefore
  @extend()
