File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -226,9 +226,15 @@ export class Log<N extends JsonNode = JsonNode<any>> implements Printable {
226
226
if ( node ) {
227
227
const rga = node . v ;
228
228
if ( rga instanceof StrNode ) {
229
- for ( const span of op . what ) {
230
- // TODO: SPAN to view: ...
229
+ let str = '' ;
230
+ for ( const span of op . what ) str += rga . spanView ( span ) . join ( '' ) ;
231
+ let after = op . obj ;
232
+ const firstDelSpan = op . what [ 0 ] ;
233
+ if ( firstDelSpan ) {
234
+ const after2 = rga . prevId ( firstDelSpan ) ;
235
+ if ( after2 ) after = after2 ;
231
236
}
237
+ builder . insStr ( op . obj , after , str ) ;
232
238
}
233
239
}
234
240
}
Original file line number Diff line number Diff line change @@ -793,6 +793,10 @@ export abstract class AbstractRga<T> {
793
793
return chunk ;
794
794
}
795
795
796
+ /**
797
+ * @param id ID of character to start the search from.
798
+ * @returns Previous ID in the RGA sequence.
799
+ */
796
800
public prevId ( id : ITimestampStruct ) : ITimestampStruct | undefined {
797
801
let chunk = this . findById ( id ) ;
798
802
if ( ! chunk ) return ;
You can’t perform that action at this time.
0 commit comments