@@ -91,7 +91,8 @@ function upgradeModifier(modifier: ModifierV0V1): Modifier[] {
91
91
}
92
92
93
93
function upgradePrimitiveTarget (
94
- target : PartialPrimitiveTargetV0V1
94
+ target : PartialPrimitiveTargetV0V1 ,
95
+ action : ActionType
95
96
) : PartialPrimitiveTargetDesc {
96
97
const {
97
98
type,
@@ -108,12 +109,16 @@ function upgradePrimitiveTarget(
108
109
if ( position === "before" ) {
109
110
if ( insideOutsideType === "inside" ) {
110
111
modifiers . push ( { type : "position" , position : "start" } ) ;
112
+ } else if ( action === "remove" ) {
113
+ modifiers . push ( { type : "leading" } ) ;
111
114
} else {
112
115
modifiers . push ( { type : "position" , position : "before" } ) ;
113
116
}
114
117
} else {
115
118
if ( insideOutsideType === "inside" ) {
116
119
modifiers . push ( { type : "position" , position : "end" } ) ;
120
+ } else if ( action === "remove" ) {
121
+ modifiers . push ( { type : "trailing" } ) ;
117
122
} else {
118
123
modifiers . push ( { type : "position" , position : "after" } ) ;
119
124
}
@@ -172,13 +177,13 @@ function upgradeTarget(
172
177
return {
173
178
type,
174
179
rangeType,
175
- anchor : upgradePrimitiveTarget ( start ) ,
176
- active : upgradePrimitiveTarget ( end ) ,
180
+ anchor : upgradePrimitiveTarget ( start , action ) ,
181
+ active : upgradePrimitiveTarget ( end , action ) ,
177
182
excludeAnchor : excludeStart ?? false ,
178
183
excludeActive : excludeEnd ?? false ,
179
184
} ;
180
185
case "primitive" :
181
- return upgradePrimitiveTarget ( target ) ;
186
+ return upgradePrimitiveTarget ( target , action ) ;
182
187
}
183
188
}
184
189
0 commit comments