mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Add cancelScan()
This commit is contained in:
@@ -275,8 +275,7 @@ class Project extends Model
|
||||
excludeVcsIgnores: atom.config.get('core.excludeVcsIgnoredPaths')
|
||||
exclusions: atom.config.get('core.ignoredNames')
|
||||
|
||||
if @scanTask?
|
||||
@scanTask.terminate()
|
||||
@cancelScan()
|
||||
|
||||
@scanTask = Task.once require.resolve('./scan-handler'), @getPath(), regex.source, searchOptions, =>
|
||||
@scanTask = null
|
||||
@@ -297,6 +296,12 @@ class Project extends Model
|
||||
|
||||
deferred.promise
|
||||
|
||||
# Public: Cancels the current scan task if there is one running.
|
||||
cancelScan: ->
|
||||
if @scanTask?
|
||||
@scanTask.terminate()
|
||||
@scanTask = null
|
||||
|
||||
# Public: Performs a replace across all the specified files in the project.
|
||||
#
|
||||
# * regex: A RegExp to search with
|
||||
|
||||
Reference in New Issue
Block a user