diff --git a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts index cb609d016d2..30866bc8fd4 100644 --- a/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts +++ b/src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts @@ -1079,17 +1079,6 @@ configurationRegistry.registerConfiguration({ ], default: 'fullCell' }, - [NotebookSetting.anchorToFocusedCell]: { - markdownDescription: nls.localize('notebook.scrolling.anchorToFocusedCell.description', "Experimental. Keep the focused cell steady while surrounding cells change size."), - type: 'string', - enum: ['auto', 'on', 'off'], - markdownEnumDescriptions: [ - nls.localize('notebook.scrolling.anchorToFocusedCell.auto.description', "Anchor the viewport to the focused cell depending on context unless {0} is set to {1}.", 'notebook.scrolling.revealCellBehavior', 'none'), - nls.localize('notebook.scrolling.anchorToFocusedCell.on.description', "Always anchor the viewport to the focused cell."), - nls.localize('notebook.scrolling.anchorToFocusedCell.off.description', "The focused cell may shift around as cells resize.") - ], - default: 'auto' - }, [NotebookSetting.cellChat]: { markdownDescription: nls.localize('notebook.cellChat', "Enable experimental floating chat widget in notebooks."), type: 'boolean', diff --git a/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.ts b/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.ts index a592bd2656b..7e1b5d0a13d 100644 --- a/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.ts +++ b/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.ts @@ -38,12 +38,11 @@ export class NotebookCellAnchor implements IDisposable { const newFocusBottom = cellListView.elementTop(focusedIndex) + cellListView.elementHeight(focusedIndex) + heightDelta; const viewBottom = cellListView.renderHeight + cellListView.getScrollTop(); const focusStillVisible = viewBottom > newFocusBottom; - const anchorFocusedSetting = this.configurationService.getValue(NotebookSetting.anchorToFocusedCell); const allowScrolling = this.configurationService.getValue(NotebookSetting.scrollToRevealCell) !== 'none'; const growing = heightDelta > 0; - const autoAnchor = allowScrolling && growing && !focusStillVisible && anchorFocusedSetting !== 'off'; + const autoAnchor = allowScrolling && growing && !focusStillVisible; - if (autoAnchor || anchorFocusedSetting === 'on') { + if (autoAnchor) { this.watchAchorDuringExecution(executingCellUri); return true; } diff --git a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts index 07090093a0c..8e51f48689d 100644 --- a/src/vs/workbench/contrib/notebook/common/notebookCommon.ts +++ b/src/vs/workbench/contrib/notebook/common/notebookCommon.ts @@ -952,7 +952,6 @@ export const NotebookSetting = { outlineShowCodeCellSymbols: 'notebook.outline.showCodeCellSymbols', breadcrumbsShowCodeCells: 'notebook.breadcrumbs.showCodeCells', scrollToRevealCell: 'notebook.scrolling.revealNextCellOnExecute', - anchorToFocusedCell: 'notebook.scrolling.experimental.anchorToFocusedCell', cellChat: 'notebook.experimental.cellChat', notebookVariablesView: 'notebook.experimental.variablesView', InteractiveWindowPromptToSave: 'interactiveWindow.promptToSaveOnClose', diff --git a/src/vs/workbench/contrib/notebook/test/browser/notebookCellList.test.ts b/src/vs/workbench/contrib/notebook/test/browser/notebookCellList.test.ts index 2e32a24b22f..6f9de776b53 100644 --- a/src/vs/workbench/contrib/notebook/test/browser/notebookCellList.test.ts +++ b/src/vs/workbench/contrib/notebook/test/browser/notebookCellList.test.ts @@ -26,10 +26,7 @@ suite('NotebookCellList', () => { setup(() => { testDisposables = new DisposableStore(); instantiationService = setupInstantiationService(testDisposables); - config = new TestConfigurationService({ - [NotebookSetting.anchorToFocusedCell]: 'auto' - }); - + config = new TestConfigurationService(); instantiationService.stub(IConfigurationService, config); }); diff --git a/src/vs/workbench/contrib/notebook/test/browser/notebookViewZones.test.ts b/src/vs/workbench/contrib/notebook/test/browser/notebookViewZones.test.ts index 2f87376fe5c..bace7743e88 100644 --- a/src/vs/workbench/contrib/notebook/test/browser/notebookViewZones.test.ts +++ b/src/vs/workbench/contrib/notebook/test/browser/notebookViewZones.test.ts @@ -12,7 +12,7 @@ import { TestConfigurationService } from 'vs/platform/configuration/test/common/ import { TestInstantiationService } from 'vs/platform/instantiation/test/common/instantiationServiceMock'; import { NotebookCellsLayout } from 'vs/workbench/contrib/notebook/browser/view/notebookCellListView'; import { FoldingModel } from 'vs/workbench/contrib/notebook/browser/viewModel/foldingModel'; -import { CellEditType, CellKind, NotebookSetting } from 'vs/workbench/contrib/notebook/common/notebookCommon'; +import { CellEditType, CellKind } from 'vs/workbench/contrib/notebook/common/notebookCommon'; import { createNotebookCellList, setupInstantiationService, withTestNotebook } from 'vs/workbench/contrib/notebook/test/browser/testNotebookEditor'; suite('NotebookRangeMap', () => { @@ -339,10 +339,7 @@ suite('NotebookRangeMap with whitesspaces', () => { setup(() => { testDisposables = new DisposableStore(); instantiationService = setupInstantiationService(testDisposables); - config = new TestConfigurationService({ - [NotebookSetting.anchorToFocusedCell]: 'auto' - }); - + config = new TestConfigurationService(); instantiationService.stub(IConfigurationService, config); });