@@ -7,7 +7,7 @@ import {printTree} from 'tree-dump/lib/printTree';
7
7
import { createRegistry } from '../registry/registry' ;
8
8
import { PersistedSlice } from '../slice/PersistedSlice' ;
9
9
import { stringify } from '../../../json-text/stringify' ;
10
- import { CommonSliceType , type SliceTypeSteps , type SliceType , SliceTypeStep } from '../slice' ;
10
+ import { CommonSliceType , type SliceTypeSteps , type SliceType , type SliceTypeStep } from '../slice' ;
11
11
import { isLetter , isPunctuation , isWhitespace , stepsEqual } from './util' ;
12
12
import { ValueSyncStore } from '../../../util/events/sync-store' ;
13
13
import { MarkerOverlayPoint } from '../overlay/MarkerOverlayPoint' ;
@@ -861,7 +861,13 @@ export class Editor<T = string> implements Printable {
861
861
return slices . slices . insMarkerAfter ( after . id , type , data ) ;
862
862
}
863
863
864
- public tglMarkerAt ( point : Point < T > , type : SliceType , data ?: unknown , slices : EditorSlices < T > = this . saved , def : SliceTypeStep = SliceTypeCon . p ) : void {
864
+ public tglMarkerAt (
865
+ point : Point < T > ,
866
+ type : SliceType ,
867
+ data ?: unknown ,
868
+ slices : EditorSlices < T > = this . saved ,
869
+ def : SliceTypeStep = SliceTypeCon . p ,
870
+ ) : void {
865
871
const overlay = this . txt . overlay ;
866
872
const markerPoint = overlay . getOrNextLowerMarker ( point ) ;
867
873
if ( markerPoint ) {
@@ -872,8 +878,7 @@ export class Editor<T = string> implements Printable {
872
878
if ( tag === typeTag ) type = [ ...type . slice ( 0 , - 1 ) , def ] ;
873
879
if ( Array . isArray ( type ) && type . length === 1 ) type = type [ 0 ] ;
874
880
marker . update ( { type} ) ;
875
- } else
876
- this . setStartMarker ( type , data , slices ) ;
881
+ } else this . setStartMarker ( type , data , slices ) ;
877
882
}
878
883
879
884
public updMarkerAt ( point : Point < T > , type : SliceType , data ?: unknown , slices : EditorSlices < T > = this . saved ) : void {
@@ -883,8 +888,7 @@ export class Editor<T = string> implements Printable {
883
888
const marker = markerPoint . marker ;
884
889
if ( Array . isArray ( type ) && type . length === 1 ) type = type [ 0 ] ;
885
890
marker . update ( { type} ) ;
886
- } else
887
- this . setStartMarker ( type , data , slices ) ;
891
+ } else this . setStartMarker ( type , data , slices ) ;
888
892
}
889
893
890
894
/**
@@ -894,7 +898,12 @@ export class Editor<T = string> implements Printable {
894
898
* @param type Slice type to toggle.
895
899
* @param data Custom data of the slice.
896
900
*/
897
- public tglMarker ( type : SliceType , data ?: unknown , slices : EditorSlices < T > = this . saved , def : SliceTypeStep = SliceTypeCon . p ) : void {
901
+ public tglMarker (
902
+ type : SliceType ,
903
+ data ?: unknown ,
904
+ slices : EditorSlices < T > = this . saved ,
905
+ def : SliceTypeStep = SliceTypeCon . p ,
906
+ ) : void {
898
907
for ( let i = this . cursors0 ( ) , cursor = i ( ) ; cursor ; cursor = i ( ) )
899
908
this . tglMarkerAt ( cursor . start , type , data , slices , def ) ;
900
909
}
0 commit comments