Remove model and view specific observe/subscribe methods

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2021-08-23 15:07:50 -07:00
co-authored by Nathan Sobo
parent 5ecedd894d
commit fa0739ee2e
5 changed files with 24 additions and 58 deletions
+3 -3
View File
@@ -324,9 +324,9 @@ impl Editor {
) -> Self {
let display_map =
cx.add_model(|cx| DisplayMap::new(buffer.clone(), settings.borrow().clone(), None, cx));
cx.observe_model(&buffer, Self::on_buffer_changed);
cx.subscribe_to_model(&buffer, Self::on_buffer_event);
cx.observe_model(&display_map, Self::on_display_map_changed);
cx.observe(&buffer, Self::on_buffer_changed);
cx.subscribe(&buffer, Self::on_buffer_event);
cx.observe(&display_map, Self::on_display_map_changed);
let mut next_selection_id = 0;
let selection_set_id = buffer.update(cx, |buffer, cx| {