Skip to content

Commit 33164f0

Browse files
authored
Merge pull request microsoft#182925 from microsoft/revert-182786-joh/possible-cuckoo
Revert "only terminate session when content change moves all cursors outside of whole range, don't use change range for this"
2 parents 748cd8e + b4bc953 commit 33164f0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

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

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

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

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

0 commit comments

Comments
 (0)