       task.on 'scan:paths-searched', (numberOfPathsSearched) ->
         options.onPathsSearched(numberOfPathsSearched)
 
-    deferred
+    deferred.promise
 
   # Private:
   buildEditSessionForBuffer: (buffer, editSessionOptions) ->

      iterator = options
      options = {}

    deferred = $.Deferred()

    searchOptions =
      ignoreCase: regex.ignoreCase

Q = require 'q'

_ = require './underscore-extensions'
telepath = require 'telepath'
{Range} = telepath
TextBuffer = require './text-buffer'
