Skip to content

Commit 79fa27d

Browse files
committed
Fix bad cell layout after "toggle word wrap"
Fix microsoft#101940
1 parent 182db07 commit 79fa27d

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,28 +293,27 @@ export class CodeCell extends Disposable {
293293

294294
private onCellWidthChange(): void {
295295
const realContentHeight = this.templateData.editor!.getContentHeight();
296+
this.viewCell.editorHeight = realContentHeight;
297+
this.relayoutCell();
298+
296299
this.layoutEditor(
297300
{
298301
width: this.viewCell.layoutInfo.editorWidth,
299302
height: realContentHeight
300303
}
301304
);
302-
303-
this.viewCell.editorHeight = realContentHeight;
304-
this.relayoutCell();
305305
}
306306

307307
private onCellHeightChange(newHeight: number): void {
308308
const viewLayout = this.templateData.editor!.getLayoutInfo();
309+
this.viewCell.editorHeight = newHeight;
310+
this.relayoutCell();
309311
this.layoutEditor(
310312
{
311313
width: viewLayout.width,
312314
height: newHeight
313315
}
314316
);
315-
316-
this.viewCell.editorHeight = newHeight;
317-
this.relayoutCell();
318317
}
319318

320319
renderOutput(currOutput: IProcessedOutput, index: number, beforeElement?: HTMLElement) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,13 +310,13 @@ export class StatefullMarkdownCell extends Disposable {
310310
let viewLayout = this.editor!.getLayoutInfo();
311311

312312
if (e.contentHeightChanged) {
313+
this.viewCell.editorHeight = e.contentHeight;
313314
this.editor!.layout(
314315
{
315316
width: viewLayout.width,
316317
height: e.contentHeight
317318
}
318319
);
319-
this.viewCell.editorHeight = e.contentHeight;
320320
}
321321
}));
322322

0 commit comments

Comments
 (0)