 
   setInsertionCheckpoint: ->
     @insertionCheckpoint ?= @editor.createCheckpoint()
+
+  resetInsertionCheckpoint: ->
+    @insertionCheckpoint = null
+
+  getInsertionCheckpoint: ->
+    @insertionCheckpoint
 
   # Visual
   # -------------------------

          @replacedCharsBySelection[s.id] ?= []
          @replacedCharsBySelection[s.id].push(swrap(s).replace(char))

    @replaceModeSubscriptions.add new Disposable =>
      @replacedCharsBySelection = null

  deactivateReplaceMode: ->
    @replaceModeSubscriptions?.dispose()
    @replaceModeSubscriptions = null

  replaceModeBackspace: ->
    for s in @editor.getSelections()

      submode = null

    # Deactivate old mode
    @deactivator?.dispose() if (mode isnt @mode)

    # Activate
    @deactivator = switch mode
      when 'normal' then @activateNormalMode()
      when 'insert' then @activateInsertMode(submode)
      when 'visual' then @activateVisualMode(submode)
      when 'operator-pending' then new Disposable

    # Now update mode variables and update CSS selectors.
    [@mode, @submode] = [mode, submode]
