Automatically unfollow when editing, scrolling or changing selections
This commit is contained in:
@@ -360,7 +360,7 @@ impl SearchBar {
|
||||
cx: &mut ViewContext<Self>,
|
||||
) {
|
||||
match event {
|
||||
editor::Event::Edited => {
|
||||
editor::Event::Edited { .. } => {
|
||||
self.query_contains_error = false;
|
||||
self.clear_matches(cx);
|
||||
self.update_matches(true, cx);
|
||||
@@ -377,8 +377,8 @@ impl SearchBar {
|
||||
cx: &mut ViewContext<Self>,
|
||||
) {
|
||||
match event {
|
||||
editor::Event::Edited => self.update_matches(false, cx),
|
||||
editor::Event::SelectionsChanged => self.update_match_index(cx),
|
||||
editor::Event::Edited { .. } => self.update_matches(false, cx),
|
||||
editor::Event::SelectionsChanged { .. } => self.update_match_index(cx),
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ impl ProjectSearchView {
|
||||
cx.observe(&results_editor, |_, _, cx| cx.emit(ViewEvent::UpdateTab))
|
||||
.detach();
|
||||
cx.subscribe(&results_editor, |this, _, event, cx| {
|
||||
if matches!(event, editor::Event::SelectionsChanged) {
|
||||
if matches!(event, editor::Event::SelectionsChanged { .. }) {
|
||||
this.update_match_index(cx);
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user