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

      when 'linewise' then swrap(s).expandOverLine() for s in selections
      when 'blockwise' then @vimState.operationStack.push new BlockwiseSelect(@vimState)

  deactivateVisualMode: ->
    @restoreCharacterwiseRange()
    for s in @editor.getSelections()
      swrap(s).resetProperties()
      s.cursor.moveLeft() unless (s.isEmpty() or s.isReversed())
      s.clear(autoscroll: false)

  restoreCharacterwiseRange: ->
    switch @submode

      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]
