bug: Fix focus of search input when toggling the pane
MODIFY
lib/find-options.coffee
lib/find-options.coffee
@@ -31,6 +31,9 @@ class FindOptions
onDidChange: (callback) ->
@emitter.on('did-change', callback)
+ onDidChangeUseRegex: (callback) ->
+ @emitter.on('did-change-useRegex', callback)
+
onDidChangeReplacePattern: (callback) ->
@emitter.on('did-change-replacePattern', callback)

MODIFY
lib/find-view.js
lib/find-view.js
@@ -21,6 +21,7 @@ class FindView {
this.handleEvents();
this.clearMessage();
this.updateOptionViews();
+ this.updateSyntaxHighlighting();
this.updateReplaceEnablement();
this.createWrapIcon();
}
@@ -277,6 +278,7 @@ class FindView {
this.subscriptions.add(this.model.onDidError(this.findError.bind(this)));
this.subscriptions.add(this.model.onDidChangeCurrentResult(this.updateResultCounter.bind(this)));
this.subscriptions.add(this.model.getFindOptions().onDidChange(this.updateOptionViews.bind(this)));
+ this.subscriptions.add(this.model.getFindOptions().onDidChangeUseRegex(this.updateSyntaxHighlighting.bind(this)));
this.refs.closeButton.addEventListener('click', () => this.panel && this.panel.hide());
this.refs.regexOptionButton.addEventListener('click', this.toggleRegexOption.bind(this));
@@ -633,7 +635,6 @@ class FindView {
updateOptionViews() {
this.updateOptionButtons();
this.updateOptionsLabel();
- this.updateSyntaxHighlighting();
}
updateSyntaxHighlighting() {

MODIFY
lib/project-find-view.js
lib/project-find-view.js
@@ -32,6 +32,7 @@ class ProjectFindView {
this.clearMessages();
this.updateOptionViews();
+ this.updateSyntaxHighlighting();
}
update() {}
@@ -235,6 +236,7 @@ class ProjectFindView {
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.subscriptions.add(this.model.getFindOptions().onDidChangeUseRegex(this.updateSyntaxHighlighting.bind(this)));
this.element.addEventListener('focus', () => this.findEditor.element.focus());
this.refs.closeButton.addEventListener('click', () => this.panel && this.panel.hide());
@@ -492,7 +494,6 @@ class ProjectFindView {
updateOptionViews() {
this.updateOptionButtons();
this.updateOptionsLabel();
- this.updateSyntaxHighlighting();
}
updateSyntaxHighlighting() {

:bug: Fix focus of search input when toggling the pane