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

    if swrap(selection).getProperties().head?
      if @isWithOccurrence()
        # Deffer restoring cursor point.
        # restorePoint is processed one by one, so immediately updating cursorPosition result in intersecting range with other selection
        # when intersecting selection is destroyed, cursor is moved automatically.
        @onDidFinishOperation -> restore()
      else
        restore()

      @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
