   execute: (count=1) ->
     {text, type} = @vimState.getRegister(@register) || {}
     return unless text
-    buffer = @editor.getBuffer()
-
-    buffer.transact =>
+
+    @undoTransaction =>
       _.times count, =>
         if type == 'linewise' and @location == 'after'
           @editor.moveCursorDown()

          @editor.moveCursorUp()
          @editor.moveCursorToFirstCharacterOfLine()

  # Public: Not implemented.
  #
  # Returns nothing.
  compose: (register) ->
    throw new OperatorError("Not Implemented")

#
# It combines the current line with the following line.
#
class Join
  constructor: (@editor) ->

  isComplete: -> true

  # Public: Combines the current with the following lines
  #

      if @motion.isLinewise?()
        @editor.setCursorScreenPosition([cursor.getScreenRow(), 0])

#
# It changes everything selected by the following motion.
#
class Change extends Operator
  # Public: Changes the text selected by the given motion.
  #
  # count - The number of times to execute.
  #
  # Returns nothing.
  execute: (count=1) ->
    operator = new Delete(@editor, @vimState, allowEOL: true, selectOptions: {excludeWhitespace: true})
    operator.compose(@motion)
    operator.execute(count)

    @vimState.activateInsertMode()

#
# It copies everything selected by the following motion.
#
class Yank extends Operator
  register: '"'

  # Public: Copies the text selected by the given motion.
  #
