Skip to content

Commit 4ffcc0d

Browse files
committed
make anchor setting experimental and refine descriptions
1 parent 4733324 commit 4ffcc0d

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/vs/workbench/contrib/notebook/browser/notebook.contribution.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1031,11 +1031,13 @@ configurationRegistry.registerConfiguration({
10311031
default: 'fullCell'
10321032
},
10331033
[NotebookSetting.anchorToFocusedCell]: {
1034-
markdownDescription: nls.localize('notebook.scrolling.anchorToFocusedCell.description', "Keep the focused cell steady while surrounding cells change size"),
1034+
markdownDescription: nls.localize('notebook.scrolling.anchorToFocusedCell.description', "Keep the focused cell steady while surrounding cells change size."),
10351035
type: 'string',
1036-
enum: ['auto', 'true', 'false'],
1036+
enum: ['auto', 'on', 'off'],
10371037
markdownEnumDescriptions: [
1038-
nls.localize('notebook.scrolling.anchorToFocusedCell.auto.description', "Anchor to the focused cell when the resized cell is partially visible unless {0} is set to {1}", 'notebook.scrolling.revealCellBehavior', 'none')
1038+
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'),
1039+
nls.localize('notebook.scrolling.anchorToFocusedCell.on.description', "Always anchor the viewport to the focused cell."),
1040+
nls.localize('notebook.scrolling.anchorToFocusedCell.off.description', "The focused cell may shift around as cells resize.")
10391041
],
10401042
default: 'auto'
10411043
}

src/vs/workbench/contrib/notebook/browser/view/notebookCellList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ export class NotebookCellList extends WorkbenchList<CellViewModel> implements ID
12081208
const anchorFocusedSetting = this.configurationService.getValue(NotebookSetting.anchorToFocusedCell);
12091209
const allowScrolling = this.configurationService.getValue(NotebookSetting.scrollToRevealCell) !== 'none';
12101210
const scrollHeuristic = allowScrolling && anchorFocusedSetting === 'auto' && this.view.elementTop(index) < this.view.getScrollTop();
1211-
if (focused && (anchorFocusedSetting === 'true' || scrollHeuristic)) {
1211+
if (focused && (anchorFocusedSetting === 'on' || scrollHeuristic)) {
12121212
this.view.updateElementHeight(index, size, focus);
12131213
}
12141214

src/vs/workbench/contrib/notebook/common/notebookCommon.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -965,7 +965,7 @@ export const NotebookSetting = {
965965
remoteSaving: 'notebook.experimental.remoteSave',
966966
gotoSymbolsAllSymbols: 'notebook.gotoSymbols.showAllSymbols',
967967
scrollToRevealCell: 'notebook.scrolling.revealCellBehavior',
968-
anchorToFocusedCell: 'notebook.scrolling.anchorToFocusedCell'
968+
anchorToFocusedCell: 'notebook.scrolling.experimental.anchorToFocusedCell'
969969
} as const;
970970

971971
export const enum CellStatusbarAlignment {

0 commit comments

Comments
 (0)