 
     cursorPosition = cursor.getBufferPosition()
     ranges = []
-    @editor.scan @getSearchTerm(@input), ({range}) ->
+    pattern = @getPattern(@input)
+    @editor.scan pattern, ({range}) ->
       ranges.push range
 
     [rangesBefore, rangesAfter] = _.partition ranges, ({start}) =>

  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()
    if @isBackwards()
      scanRange = [start, cursorPoint.translate([0, unOffset])]
      method    = 'backwardsScanInBufferRange'

    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

