Skip to content

Commit 7a24d62

Browse files
authored
Disable variable line heights in notebook cells (microsoft#251063)
1 parent 6bfb59d commit 7a24d62

File tree

5 files changed

+8
-2
lines changed

5 files changed

+8
-2
lines changed

src/vs/workbench/contrib/notebook/browser/diff/diffComponents.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,8 @@ abstract class AbstractElementRenderer extends Disposable {
860860
height: this.cell.layoutInfo.metadataHeight
861861
},
862862
overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode(),
863-
readOnly: false
863+
readOnly: false,
864+
allowVariableLineHeights: false
864865
}, {});
865866
this.layout({ metadataHeight: true });
866867
this._metadataEditorDisposeStore.add(this._metadataEditor);
@@ -956,7 +957,8 @@ abstract class AbstractElementRenderer extends Disposable {
956957
width: Math.min(OUTPUT_EDITOR_HEIGHT_MAGIC, this.cell.getComputedCellContainerWidth(this.notebookEditor.getLayoutInfo(), false, this.cell.type === 'unchanged' || this.cell.type === 'modified') - 32),
957958
height: this.cell.layoutInfo.rawOutputHeight
958959
},
959-
overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode()
960+
overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode(),
961+
allowVariableLineHeights: false
960962
}, {});
961963
this._outputEditorDisposeStore.add(this._outputEditor);
962964

src/vs/workbench/contrib/notebook/browser/diff/notebookDiffList.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,7 @@ function buildSourceEditor(instantiationService: IInstantiationService, notebook
621621
},
622622
automaticLayout: false,
623623
overflowWidgetsDomNode: notebookEditor.getOverflowContainerDomNode(),
624+
allowVariableLineHeights: false,
624625
readOnly: true,
625626
}, {
626627
contributions: EditorExtensionsRegistry.getEditorContributions().filter(c => skipContributions.indexOf(c.id) === -1)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,7 @@ export class MarkupCell extends Disposable {
331331
width: width,
332332
height: editorHeight
333333
},
334+
allowVariableLineHeights: false,
334335
// overflowWidgetsDomNode: this.notebookEditor.getOverflowContainerDomNode()
335336
}, {
336337
contributions: this.notebookEditor.creationOptions.cellEditorContributions

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export class NotebookCellEditorPool extends Disposable {
6161
handleMouseWheel: false,
6262
useShadows: false,
6363
},
64+
allowVariableLineHeights: false,
6465
}, {
6566
contributions: this.notebookEditor.creationOptions.cellEditorContributions
6667
}));

src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,7 @@ export class CodeCellRenderer extends AbstractCellRenderer implements IListRende
286286

287287
const editor = editorInstaService.createInstance(CodeEditorWidget, editorContainer, {
288288
...this.editorOptions.getDefaultValue(),
289+
allowVariableLineHeights: false,
289290
dimension: {
290291
width: 0,
291292
height: 0

0 commit comments

Comments
 (0)