     if editor?
       findPattern = editor.getSelectedText() or editor.getWordUnderCursor()
       findPattern = Util.escapeRegex(findPattern) if @model.getFindOptions().useRegex
-      @model.search(findPattern) if findPattern
+      @search(findPattern) if findPattern
 
   findNextSelected: =>
     @setSelectionAsFindPattern()

      atom.beep()

  replaceAll: =>
    @model.search(@findEditor.getText())
    if @markers?.length
      @replaceHistory.store()
      @findHistory.store()

    @replace('findPrevious', 'firstMarkerIndexBeforeCursor')

  replace: (nextOrPreviousFn, nextIndexFn) ->
    @search()
    @findHistory.store()
    @replaceHistory.store()

