   getPaths: ->
     @paths
 
+  markResults: ->
+    @markedResults = {}
+    for filePath, val of @results
+      @markedResults[filePath] = true
+    @markedResults
+
+  removeMarkedResults: ->
+    for filePath, val of @markedResults
+      @removeResult(filePath)
+    @markedResults = null
+
+  unmarkResult: (filePath) ->
+    delete @markedResults[filePath]
+
   getResult: (filePath) ->
     @results[filePath]
 
   setResult: (filePath, result) ->
+    @unmarkResult(filePath)
     if result
       @addResult(filePath, result)
     else

  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()

    @active = true
    @regex = @getRegex(pattern)

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

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

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