@@ -8,13 +8,13 @@ use crate::{
88 api:: { Cursor , Selection , User , controller:: ControllerCallback } ,
99 ext:: IgnorableError ,
1010} ;
11- use codemp_proto:: cursor:: { CursorEvent , CursorPosition } ;
11+ use codemp_proto:: cursor:: { CursorEvent , CursorUpdate } ;
1212
1313use super :: controller:: { CursorController , CursorControllerInner } ;
1414
1515struct CursorWorker {
1616 workspace_id : String ,
17- op : mpsc:: UnboundedReceiver < CursorPosition > ,
17+ op : mpsc:: UnboundedReceiver < CursorUpdate > ,
1818 map : Arc < dashmap:: DashMap < Uuid , User > > ,
1919 stream : mpsc:: Receiver < oneshot:: Sender < Option < Cursor > > > ,
2020 poll : mpsc:: UnboundedReceiver < oneshot:: Sender < ( ) > > ,
@@ -32,11 +32,12 @@ impl CursorWorker {
3232 if let Some ( user_name) = self . map . get ( & user_id) . map ( |u| u. name . clone ( ) ) {
3333 Some ( Cursor {
3434 user : user_name,
35+ buffer : event. position . buffer ,
3536 sel : event
3637 . position
38+ . cursors
3739 . into_iter ( )
3840 . map ( |x| Selection {
39- buffer : x. buffer . path ,
4041 start_row : x. start . row ,
4142 start_col : x. start . col ,
4243 end_row : x. end . row ,
@@ -56,7 +57,7 @@ impl CursorWorker {
5657impl CursorController {
5758 pub ( crate ) fn spawn (
5859 user_map : Arc < dashmap:: DashMap < Uuid , User > > ,
59- tx : mpsc:: Sender < CursorPosition > ,
60+ tx : mpsc:: Sender < CursorUpdate > ,
6061 rx : Streaming < CursorEvent > ,
6162 workspace_id : Uuid ,
6263 ) -> Self {
@@ -95,7 +96,7 @@ impl CursorController {
9596 #[ tracing:: instrument( skip( worker, tx, rx) , fields( ws = worker. workspace_id) ) ]
9697 async fn work (
9798 mut worker : CursorWorker ,
98- tx : mpsc:: Sender < CursorPosition > ,
99+ tx : mpsc:: Sender < CursorUpdate > ,
99100 mut rx : Streaming < CursorEvent > ,
100101 ) {
101102 tracing:: debug!( "starting cursor worker" ) ;
0 commit comments