Skip to content

Commit 1c8bc27

Browse files
authored
only terminate session when content change moves all cursors outside of whole range, don't use change range for this (microsoft#182786)
1 parent 4b71b8e commit 1c8bc27

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/vs/workbench/contrib/interactiveEditor/browser/interactiveEditorController.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -267,14 +267,12 @@ export class InteractiveEditorController implements IEditorContribution {
267267
}
268268

269269
const wholeRange = this._activeSession!.wholeRange;
270-
let editIsOutsideOfWholeRange = false;
271-
for (const { range } of e.changes) {
272-
editIsOutsideOfWholeRange = !Range.areIntersectingOrTouching(range, wholeRange);
273-
}
270+
const someSelectionInsideOfWholeRange = this._editor.getSelections()!
271+
.some(sel => Range.areIntersectingOrTouching(sel, wholeRange));
274272

275-
this._activeSession!.recordExternalEditOccurred(editIsOutsideOfWholeRange);
273+
this._activeSession!.recordExternalEditOccurred(someSelectionInsideOfWholeRange);
276274

277-
if (editIsOutsideOfWholeRange) {
275+
if (!someSelectionInsideOfWholeRange) {
278276
this._logService.trace('[IE] text changed outside of whole range, FINISH session');
279277
this._finishExistingSession();
280278
}

0 commit comments

Comments
 (0)