   isBackwards: ->
     @backwards
 
-  getOffset: ->
-    if @isBackwards() then @offset else -@offset
-
-  getUnOffset: ->
-    -@getOffset() * @isRepeatFind()
-
   find: (cursor) ->
     cursorPoint = cursor.getBufferPosition()
     {start, end} = @editor.bufferRangeForBufferRow(cursorPoint.row)
 
-    points   = []
-    offset   = @getOffset()
-    unOffset = @getUnOffset()
+    offset   = if @isBackwards() then @offset else -@offset
+    unOffset = -offset * @isRepeatFind()
     if @isBackwards()
       scanRange = [start, cursorPoint.translate([0, unOffset])]
       method    = 'backwardsScanInBufferRange'


    cursorPosition = cursor.getBufferPosition()
    ranges = []
    @editor.scan @getSearchTerm(@input), ({range}) ->
      ranges.push range

    [rangesBefore, rangesAfter] = _.partition ranges, ({start}) =>

    ranges.reverse() if @isBackwards()
    ranges

  # getPattern: (text) ->
  #   flags = 'g'
  #   flags += 'i' if settings.get('useSmartcaseForSearch') and text.match('[A-Z]')
  #   new RegExp(_.escapeRegExp(text), flags)

  getPattern: (term) ->
    modifiers = {'g': true}
    if not term.match('[A-Z]') and settings.get('useSmartcaseForSearch')
      modifiers['i'] = true

