@@ -328,17 +328,18 @@ fn controller_command<C: ClientController>(
328
328
match ( focus, anchor) {
329
329
( Some ( focus) , Some ( anchor) ) => {
330
330
client. client_op ( |mut ctx| {
331
- let op = cur_to_caret ( ctx. clone ( ) , & focus, Pos :: Focus ) ?;
332
- ctx. doc = Op :: apply ( & ctx. doc , & op) ;
333
- let op2 = cur_to_caret ( ctx, & anchor, Pos :: Anchor ) ?;
334
- Ok ( Op :: compose ( & op, & op2) )
331
+ let op = cur_to_caret ( & ctx, & focus, Pos :: Focus ) ?;
332
+ ctx = ctx. apply ( & op) ?;
333
+ let op2 = cur_to_caret ( & ctx, & anchor, Pos :: Anchor ) ?;
334
+ ctx = ctx. apply ( & op2) ?;
335
+ Ok ( ctx. result ( ) )
335
336
} ) ?;
336
337
}
337
338
( Some ( focus) , None ) => {
338
- client. client_op ( |doc | cur_to_caret ( doc , & focus, Pos :: Focus ) ) ?;
339
+ client. client_op ( |ctx | cur_to_caret ( & ctx , & focus, Pos :: Focus ) ) ?;
339
340
}
340
341
( None , Some ( anchor) ) => {
341
- client. client_op ( |doc | cur_to_caret ( doc , & anchor, Pos :: Anchor ) ) ?;
342
+ client. client_op ( |ctx | cur_to_caret ( & ctx , & anchor, Pos :: Anchor ) ) ?;
342
343
}
343
344
( None , None ) => { } // ???
344
345
}
@@ -428,7 +429,7 @@ pub trait ClientController {
428
429
429
430
value = Task :: ControllerCommand ( ControllerCommand :: Cursor {
430
431
focus : Some ( cursors[ idx] . clone ( ) ) ,
431
- anchor : None ,
432
+ anchor : Some ( cursors [ idx ] . clone ( ) ) ,
432
433
} ) ;
433
434
}
434
435
0 commit comments