Automatically unfollow when editing, scrolling or changing selections

This commit is contained in:
Antonio Scandurra
2022-03-22 09:17:01 +01:00
parent c550fc3f01
commit 3117554568
14 changed files with 214 additions and 60 deletions
+3 -3
View File
@@ -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),
_ => {}
}
}
+1 -1
View File
@@ -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);
}
})