   acceptCurrentSelection: true
 
   bufferCheckpointByPurpose: null
+  mutateSelectionOrderd: false
 
   # Experimentaly allow selectTarget before input Complete
   # -------------------------

  execute: ->
    @startMutation =>
      if @selectTarget()
        for selection in @editor.getSelections()
          @mutateSelection(selection)
        @restoreCursorPositionsIfNecessary()


      if settings.get('flashOnOperate') and (@getName() not in settings.get('flashOnOperateBlacklist'))
        @vimState.flash(@newRanges, type: @flashTypeForOccurrence)

  replaceNumberInBufferRange: (scanRange, fn=null) ->
    newRanges = []
    @pattern ?= ///#{settings.get('numberRegex')}///g
    @editor.scanInBufferRange @pattern, scanRange, (event) =>
      return if fn? and not fn(event)
      {matchText, replace} = event
      nextNumber = @getNextNumber(matchText)
      newRanges.push(replace(String(nextNumber)))
    newRanges

  mutateSelection: (selection) ->
    scanRange = selection.getBufferRange()
    if @instanceof('IncrementNumber') or @target.is('CurrentSelection')
      @newRanges.push(@replaceNumberInBufferRange(scanRange)...)
      selection.cursor.setBufferPosition(scanRange.start)
    else
      initialPoint = @mutationManager.getInitialPointForSelection(selection)
      newRanges = @replaceNumberInBufferRange scanRange, ({range, stop}) ->
        if range.end.isGreaterThan(initialPoint)
          stop()
          true
        else
          false

      point = newRanges[0]?.end.translate([0, -1]) ? initialPoint
      selection.cursor.setBufferPosition(point)

  getNextNumber: (numberString) ->
    parseInt(numberString, 10) + @step * @getCount()

class Decrease extends Increase
  @extend()
  step: -1

# -------------------------
class IncrementNumber extends Increase
  @extend()
  baseNumber: null
  target: null
  mutateSelectionOrderd: true

  getNextNumber: (numberString) ->
    if @baseNumber?
      @baseNumber += @step * @getCount()
    else
      @baseNumber = parseInt(numberString, 10)
    @baseNumber

class DecrementNumber extends IncrementNumber
  @extend()
