     @replace('findPrevious', 'firstMarkerIndexBeforeCursor')
 
   replace: (nextOrPreviousFn, nextIndexFn) ->
-    @model.search(@findEditor.getText())
+    @search()
     @findHistory.store()
     @replaceHistory.store()
 

    @findAndSelectResult(@selectFirstMarkerBeforeCursor, options)

  findAndSelectResult: (selectFunction, {focusEditorAfter, fieldToFocus}) =>
    @model.search(@findEditor.getText())
    @findHistory.store()

    if @markers?.length > 0

    if editor?
      findPattern = editor.getSelectedText() or editor.getWordUnderCursor()
      findPattern = Util.escapeRegex(findPattern) if @model.getFindOptions().useRegex
      @search(findPattern) if findPattern

  findNextSelected: =>
    @setSelectionAsFindPattern()
