Start work on showing consistent replica ids for channel buffers

Co-authored-by: Mikayla <mikayla@zed.dev>
This commit is contained in:
Max Brunsfeld 2023-08-22 18:08:03 -07:00 committed by Mikayla
parent 11ef5e2740
commit 7e83138805
No known key found for this signature in database
8 changed files with 202 additions and 7 deletions

View file

@ -559,6 +559,7 @@ pub struct Editor {
blink_manager: ModelHandle<BlinkManager>,
show_local_selections: bool,
mode: EditorMode,
replica_id_mapping: Option<HashMap<ReplicaId, ReplicaId>>,
show_gutter: bool,
show_wrap_guides: Option<bool>,
placeholder_text: Option<Arc<str>>,
@ -1394,6 +1395,7 @@ impl Editor {
blink_manager: blink_manager.clone(),
show_local_selections: true,
mode,
replica_id_mapping: None,
show_gutter: mode == EditorMode::Full,
show_wrap_guides: None,
placeholder_text: None,
@ -1604,6 +1606,15 @@ impl Editor {
self.read_only = read_only;
}
pub fn set_replica_id_mapping(
&mut self,
mapping: HashMap<ReplicaId, ReplicaId>,
cx: &mut ViewContext<Self>,
) {
self.replica_id_mapping = Some(mapping);
cx.notify();
}
fn selections_did_change(
&mut self,
local: bool,