Option for autocompletion
MODIFY
lib/find.coffee
lib/find.coffee
@@ -122,18 +122,24 @@ module.exports =
new Disposable ->
FileIcons.resetService()
- requestAutocompletions: ->
+ toggleAutocompletions: (value) ->
+ if not @findView?
+ return
+ if value
+ @autocompleteSubscriptions = new CompositeDisposable
disposable = @autocompleteWatchEditor?(@findView.findEditor, ['default'])
if disposable?
@autocompleteSubscriptions.add(disposable)
+ else
+ @autocompleteSubscriptions?.dispose()
consumeAutocompleteWatchEditor: (watchEditor) ->
- @autocompleteSubscriptions = new CompositeDisposable
@autocompleteWatchEditor = watchEditor
- if @findView?
- requestAutocompletions()
+ atom.config.observe(
+ 'find-and-replace.autocompleteSearches',
+ (value) => @toggleAutocompletions(value))
new Disposable =>
- @autocompleteSubscriptions.dispose()
+ @autocompleteSubscriptions?.dispose()
@autocompleteWatchEditor = null
provideService: ->
@@ -175,7 +181,7 @@ module.exports =
# See https://github.com/atom/find-and-replace/issues/63
ResultsPaneView.model = @resultsModel
- @requestAutocompletions()
+ @toggleAutocompletions atom.config.get('find-and-replace.autocompleteSearches')
deactivate: ->
@findPanel?.destroy()

MODIFY
package.json
package.json
"default": true,
"title": "Show Search Wrap Icon",
"description": "Display a visual cue over the editor when looping through search results."
+ },
+ "autocompleteSearches": {
+ "type": "boolean",
+ "default": false,
+ "title": "Autocomplete Search",
+ "description": "Autocompletes entries in the find search field."
}
}
}

Option for autocompletion