@@ -232,20 +232,18 @@ export class XtabProvider implements IStatelessNextEditProvider {
232
232
233
233
const currentDocument = new CurrentDocument ( activeDocument . documentAfterEdits , cursorPosition ) ;
234
234
235
- const cursorLineIdx = cursorPosition . lineNumber - 1 /* to convert to 0-based */ ;
236
-
237
- const cursorLine = currentDocument . lines . value [ cursorLineIdx ] ;
235
+ const cursorLine = currentDocument . lines . value [ currentDocument . cursorLineOffset ] ;
238
236
const isCursorAtEndOfLine = cursorPosition . column === cursorLine . trimEnd ( ) . length ;
239
237
if ( isCursorAtEndOfLine ) {
240
238
delaySession . setExtraDebounce ( this . configService . getExperimentBasedConfig ( ConfigKey . Internal . InlineEditsExtraDebounceEndOfLine , this . expService ) ) ;
241
239
}
242
240
telemetryBuilder . setIsCursorAtLineEnd ( isCursorAtEndOfLine ) ;
243
241
244
- const areaAroundEditWindowLinesRange = this . computeAreaAroundEditWindowLinesRange ( currentDocument . lines . value , cursorLineIdx ) ;
242
+ const areaAroundEditWindowLinesRange = this . computeAreaAroundEditWindowLinesRange ( currentDocument . lines . value , currentDocument . cursorLineOffset ) ;
245
243
246
- const editWindowLinesRange = this . computeEditWindowLinesRange ( currentDocument . lines . value , cursorLineIdx , request , retryState ) ;
244
+ const editWindowLinesRange = this . computeEditWindowLinesRange ( currentDocument . lines . value , currentDocument . cursorLineOffset , request , retryState ) ;
247
245
248
- const cursorOriginalLinesOffset = Math . max ( 0 , cursorLineIdx - editWindowLinesRange . start ) ;
246
+ const cursorOriginalLinesOffset = Math . max ( 0 , currentDocument . cursorLineOffset - editWindowLinesRange . start ) ;
249
247
const editWindowLastLineLength = activeDocument . documentAfterEdits . getTransformer ( ) . getLineLength ( editWindowLinesRange . endExclusive ) ;
250
248
const editWindow = activeDocument . documentAfterEdits . getTransformer ( ) . getOffsetRange ( new Range ( editWindowLinesRange . start + 1 , 1 , editWindowLinesRange . endExclusive , editWindowLastLineLength + 1 ) ) ;
251
249
0 commit comments