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 {
226226 if ( node ) {
227227 const rga = node . v ;
228228 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 ;
231236 }
237+ builder . insStr ( op . obj , after , str ) ;
232238 }
233239 }
234240 }
Original file line number Diff line number Diff line change @@ -793,6 +793,10 @@ export abstract class AbstractRga<T> {
793793 return chunk ;
794794 }
795795
796+ /**
797+ * @param id ID of character to start the search from.
798+ * @returns Previous ID in the RGA sequence.
799+ */
796800 public prevId ( id : ITimestampStruct ) : ITimestampStruct | undefined {
797801 let chunk = this . findById ( id ) ;
798802 if ( ! chunk ) return ;
You can’t perform that action at this time.
0 commit comments