     @forceWise?
 
   # Return true unless all selection is empty.
-  # -------------------------
   selectTarget: ->
     @observeSelectAction()
     @emitWillSelectTarget()

  # For TextObject, isLinewise result is changed before / after select.
  # This mean return value may change depending on when you call.
  needStay: ->
    @wasNeedStay ?= do =>
      if @instanceof('TransformString')
        param = "stayOnTransformString"
      else

      @forceWise = wise

  # @target - TextObject or Motion to operate on.
  setTarget: (target) ->
    unless _.isFunction(target.select)
      @vimState.emitter.emit('did-fail-to-set-target')
      throw new OperatorError("#{@getName()} cannot set #{target?.getName?()} as target")
    @target = target
    @target.setOperator(this)
    @modifyTargetWise(@target, @forceWise) if @hasForceWise()
    @emitDidSetTarget(this)
    this

  modifyTargetWise: (target, wise) ->
    switch wise
      when 'characterwise'
        if target.linewise
          target.linewise = false
          target.inclusive = false
        else
          target.inclusive = not target.inclusive
      when 'linewise'
        target.linewise = true

  isWithOccurrence: ->
    @withOccurrence
