@@ -369,6 +369,11 @@ const envMultiBatches: EditBatch[] = [
369369 [ [ envReuseInit . indexOf ( 'K5=' ) + 'K5=' . length , envReuseInit . indexOf ( 'K5=' ) + 'K5=' . length + 1 , '7' ] ] ,
370370 [ [ envReuseLastEq , envReuseLastEq + 1 , '8' ] ] ,
371371] ;
372+ // Shape-B adopted Seg.Ext must shift with tokDelta: insert-front (adopt suffix) then poke a later
373+ // value whose align.prefix sits in the stale-ext..shifted-ext window — unshifted Ext over-reuses.
374+ const envSegExtInit = Array . from ( { length : 8 } , ( _ , i ) => `K${ i } =${ i } ` ) . join ( '\n' ) ;
375+ const envSegExtIns = 'Z=9\n' ;
376+ const envSegExtPoke = envSegExtInit . indexOf ( 'K3=' ) + 'K3=' . length + envSegExtIns . length ;
372377const regexjsLargeInit = 'var r = /abc/g; a / b;\n' . repeat ( 60 ) ;
373378const jsLookaheadInit = 'let x = (a)\nfoo;\nbar;' ;
374379const jsLookaheadEdit = jsLookaheadInit . indexOf ( '\n' ) + 1 ; // first char of peeked-into second stmt
@@ -437,6 +442,8 @@ const EDIT_SCENARIOS: Record<string, EditScenario[]> = {
437442 { init : 'A=1\n\nB=2' , batches : [ [ [ 4 , 4 , '\n' ] ] ] , minReused : 1 } , // blank-line expand
438443 { init : envFlowInit , batches : [ [ [ envFlowEdit , envFlowEdit + 1 , 'x' ] ] ] , minReused : 2 } , // mid flow stmt; sides reused
439444 { init : envReuseInit , batches : envMultiBatches , longSession : true , minReused : 1 } ,
445+ // Go adopted Seg.Ext + tokDelta (pre-fix: reused 9 from stale keep-prefix watermarks).
446+ { init : envSegExtInit , batches : [ [ [ 0 , 0 , envSegExtIns ] ] , [ [ envSegExtPoke , envSegExtPoke + 1 , '9' ] ] ] , reused : 8 } ,
440447 ] ,
441448 regexjs : [
442449 { init : 'var re = /[a-z]+/i; x / y;' , batches : [ [ [ 11 , 12 , '0' ] ] ] } ,
0 commit comments