     @vimState.flasher.flash(options, fn)
 
   eachSelection: (fn) ->
-    return unless @target.select()
+    if @selected?
+      return unless @selected
+    else
+      return unless @target.select()
     @editor.transact =>
       for s in @editor.getSelections()
         if @flashTarget and settings.get('flashOnOperate')


  # [FIXME] duplicate to Yank, need to consolidate as like adjustCursor().
  execute: ->
    if @target.isLinewise?() or settings.get('stayOnTransformString')
      points = _.pluck(@editor.getSelectedBufferRanges(), 'start')
    @eachSelection (s) =>
      range = s.insertText @getNewText(s.getText())
      if @adjustCursor
        s.cursor.setBufferPosition(points?.shift() ? range.start)
    @vimState.activate('normal')

class ToggleCase extends TransformString
  @extend()

  constructor: ->
    super
    @compose @new("AnyPair", inclusive: true)
    @preSelect()

  # FIXME very inperative implementation. find more generic and consistent approach.
  # like preservePoints() and restorePoints().
  preSelect: ->
    if @target.isLinewise?() or settings.get('stayOnTransformString')
      @points = _.pluck(@editor.getSelectedBufferRanges(), 'start')
    if @selected = @target.select()
      @vimState.hover.add(@editor.getSelectedText()[0])

  onConfirm: (@char) ->
    @input = @char
