Only hide the search panel if a search was actually completed
Even a no-op one
MODIFY
lib/project-find-view.js
lib/project-find-view.js
@@ -204,9 +204,6 @@ class ProjectFindView {
};
let updateInterfaceForResults = results => {
- if (atom.config.get('find-and-replace.closeFindPanelAfterSearch')) {
- this.panel && this.panel.hide();
- }
if (results.matchCount === 0 && results.findPattern === '') {
this.clearMessages();
} else {
@@ -220,10 +217,22 @@ class ProjectFindView {
this.updateReplaceAllButtonEnablement(null);
};
+ let afterSearch = () => {
+ if (atom.config.get('find-and-replace.closeFindPanelAfterSearch')) {
+ this.panel && this.panel.hide();
+ }
+ }
+
+ let searchFinished = results => {
+ afterSearch();
+ updateInterfaceForResults(results);
+ };
+
this.subscriptions.add(this.model.onDidClear(resetInterface));
this.subscriptions.add(this.model.onDidClearReplacementState(updateInterfaceForResults));
this.subscriptions.add(this.model.onDidStartSearching(updateInterfaceForSearching));
- this.subscriptions.add(this.model.onDidFinishSearching(updateInterfaceForResults));
+ this.subscriptions.add(this.model.onDidNoopSearch(afterSearch));
+ this.subscriptions.add(this.model.onDidFinishSearching(searchFinished));
this.subscriptions.add(this.model.getFindOptions().onDidChange(this.updateOptionViews.bind(this)));
this.element.addEventListener('focus', () => this.findEditor.element.focus());

Only hide the search panel if a search was actually completed

Even a no-op one