Skip to content

Commit 01b30db

Browse files
authored
do not scroll for cursor change if text editor does not have focus (microsoft#257880)
* do not scroll for cursor change if text editor does not have focus * comment formatting
1 parent e693491 commit 01b30db

File tree

1 file changed

+6
-2
lines changed
  • src/vs/workbench/contrib/notebook/browser/view/cellParts

1 file changed

+6
-2
lines changed

src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,12 @@ export class CodeCell extends Disposable {
329329
}));
330330

331331
this._register(this.templateData.editor.onDidChangeCursorSelection((e) => {
332-
if (e.source === 'restoreState' || e.oldModelVersionId === 0) {
333-
// do not reveal the cell into view if this selection change was caused by restoring editors...
332+
if (
333+
// do not reveal the cell into view if this selection change was caused by restoring editors
334+
e.source === 'restoreState' || e.oldModelVersionId === 0
335+
// nor if the text editor is not actually focused (e.g. inline chat is focused and modifying the cell content)
336+
|| !this.templateData.editor.hasTextFocus()
337+
) {
334338
return;
335339
}
336340

0 commit comments

Comments
 (0)