From e500718212f7a49b941f2bd6a708838c9c11dc4e Mon Sep 17 00:00:00 2001 From: rebornix Date: Tue, 7 Apr 2020 11:38:46 -0700 Subject: [PATCH] do not override editor width when there is no notebook width change --- .../notebook/browser/viewModel/markdownCellViewModel.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/notebook/browser/viewModel/markdownCellViewModel.ts b/src/vs/workbench/contrib/notebook/browser/viewModel/markdownCellViewModel.ts index 69d7f227789..618e4a6fbd0 100644 --- a/src/vs/workbench/contrib/notebook/browser/viewModel/markdownCellViewModel.ts +++ b/src/vs/workbench/contrib/notebook/browser/viewModel/markdownCellViewModel.ts @@ -66,10 +66,10 @@ export class MarkdownCellViewModel extends BaseCellViewModel implements ICellVie layoutChange(state: MarkdownCellLayoutChangeEvent) { // recompute - const editorWidth = state.outerWidth !== undefined ? state.outerWidth - CELL_MARGIN * 2 - CELL_RUN_GUTTER : 0; + const editorWidth = state.outerWidth !== undefined ? state.outerWidth - CELL_MARGIN * 2 - CELL_RUN_GUTTER : this._layoutInfo.editorWidth; this._layoutInfo = { - fontInfo: state.font || null, + fontInfo: state.font || this._layoutInfo.fontInfo, editorWidth, bottomToolbarOffset: BOTTOM_CELL_TOOLBAR_HEIGHT, totalHeight: state.totalHeight === undefined ? this._layoutInfo.totalHeight : state.totalHeight -- GitLab