   # - one for undo(handled by modeManager)
   # - one for preserve last inserted text
   setCheckpoint: (purpose) ->
+    @checkpoint ?= {}
     @checkpoint[purpose] = @editor.createCheckpoint()
 
   getCheckpoint: (purpose) ->
-    @checkpoint[purpose]
+    @checkpoint?[purpose]
 
   # When each mutaion's extent is not intersecting, muitiple changes are recorded
   # e.g

  target: 'MoveToNextFoldStart'

# -------------------------
class Change extends ActivateInsertMode # FIXME
  @extend()
  requireTarget: true
  trackChange: true
  supportInsertionCount: false

  canContinueOnEmptySelection: ->
    not @isOccurrence()

        @vimState.clearSelections()

    else
      @setCheckpoint('undo')
      if @isRequireTarget()
        targetSelected = @selectTarget()
        if not targetSelected and not @canContinueOnEmptySelection()
          @vimState.activate('normal')
          return

      @observeWillDeactivateMode()

      @mutateText?()
