       commandHandler: @commandHandler.bind this
 
     # If there was a range selection when the user lanuched visual mode, then we retain the selection on exit.
-    @shouldRetainSelectionOnExit = @options.userLaunchedMode and 0 < @selection.toString().length
+    @shouldRetainSelectionOnExit = @options.userLaunchedMode and @selection.type == "Range"
 
     @onExit (event = null) =>
       if @shouldRetainSelectionOnExit


  # Scroll the focus into view.
  scrollIntoView: ->
    if @selection.anchorNode
      elementWithFocus = DomUtils.getElementWithFocus @selection, @getDirection() == backward
      Scroller.scrollIntoView elementWithFocus if elementWithFocus


    super extend options, name: "caret", indicator: "Caret mode", alterMethod: "move"

    # Establish the initial caret.
    switch @selection.type
      when "None"
        @establishInitialSelectionAnchor()
        if @selection.type == "None"
          @exit()
          HUD.showForDuration "Create a selection before entering visual mode.", 2500
          return
      when "Range"
        @movement.collapseSelectionToAnchor()

    @movement.extendByOneCharacter forward
    @movement.scrollIntoView()
