@@ -13,6 +13,7 @@ import {Model} from '../../json-crdt/model';
1313import { CONST , updateNum } from '../../json-hash' ;
1414import { SESSION } from '../../json-crdt-patch/constants' ;
1515import { s } from '../../json-crdt-patch' ;
16+ import { ExtraSlices } from './slice/ExtraSlices' ;
1617import type { ITimestampStruct } from '../../json-crdt-patch/clock' ;
1718import type { Printable } from 'tree-dump/lib/types' ;
1819import type { MarkerSlice } from './slice/MarkerSlice' ;
@@ -72,7 +73,7 @@ export class Peritext implements Printable {
7273 localSlicesModel : SlicesModel = Model . create ( EXTRA_SLICES_SCHEMA , SESSION . LOCAL ) ,
7374 ) {
7475 this . savedSlices = new Slices ( this . model , slices , this . str ) ;
75- this . extraSlices = new Slices ( extraSlicesModel , extraSlicesModel . root . node ( ) . get ( 0 ) ! , this . str ) ;
76+ this . extraSlices = new ExtraSlices ( extraSlicesModel , extraSlicesModel . root . node ( ) . get ( 0 ) ! , this . str ) ;
7677 const localApi = localSlicesModel . api ;
7778 localApi . onLocalChange . listen ( ( ) => {
7879 localApi . flush ( ) ;
@@ -249,14 +250,15 @@ export class Peritext implements Printable {
249250
250251 public toString ( tab : string = '' ) : string {
251252 const nl = ( ) => '' ;
253+ const { savedSlices, extraSlices, localSlices} = this ;
252254 return (
253255 this . constructor . name +
254256 printTree ( tab , [
255- ( tab ) => this . editor . cursor . toString ( tab ) ,
256- nl ,
257257 ( tab ) => this . str . toString ( tab ) ,
258258 nl ,
259- ( tab ) => this . savedSlices . toString ( tab ) ,
259+ savedSlices . size ( ) ? ( tab ) => savedSlices . toString ( tab ) : null ,
260+ extraSlices . size ( ) ? ( tab ) => extraSlices . toString ( tab ) : null ,
261+ localSlices . size ( ) ? ( tab ) => localSlices . toString ( tab ) : null ,
260262 nl ,
261263 ( tab ) => this . overlay . toString ( tab ) ,
262264 ] )
0 commit comments