   search: (pattern, searchPaths, replacementPattern, {onlyRunIfChanged, keepReplacementState}={}) ->
     return Q() if onlyRunIfChanged and pattern? and searchPaths? and pattern == @pattern and _.isEqual(searchPaths, @searchedPaths)
 
-    if keepReplacementState
-      @clearSearchState()
-    else
-      @clear()
+    @markResults()
 
     @active = true
     @regex = @getRegex(pattern)

  getPaths: ->
    @paths

  getResult: (filePath) ->
    @results[filePath]

  setResult: (filePath, result) ->
    if result
      @addResult(filePath, result)
    else

      @setResult(result.filePath, Result.create(result))

    @emit('search', promise)
    promise.then =>
      @removeMarkedResults()
      @emit('finished-searching', @getResultsSummary())

  replace: (pattern, searchPaths, replacementPattern, replacementPaths) ->
    regex = @getRegex(pattern)
