diff --git a/src/sql/workbench/browser/modelComponents/queryTextEditor.ts b/src/sql/workbench/browser/modelComponents/queryTextEditor.ts index ea8e369971..f6ea07783a 100644 --- a/src/sql/workbench/browser/modelComponents/queryTextEditor.ts +++ b/src/sql/workbench/browser/modelComponents/queryTextEditor.ts @@ -155,8 +155,8 @@ export class QueryTextEditor extends BaseTextEditor { let wordWrapEnabled: boolean = this._editorWorkspaceConfig && this._editorWorkspaceConfig['wordWrap'] && this._editorWorkspaceConfig['wordWrap'] === 'on' ? true : false; if (wordWrapEnabled) { for (let line = 1; line <= lineCount; line++) { - // 4 columns is equivalent to the viewport column width and the edge of the editor - if (editorWidgetModel.getLineMaxColumn(line) >= layoutInfo.viewportColumn + 4) { + // 2 columns is equivalent to the viewport column width and the edge of the editor + if (editorWidgetModel.getLineMaxColumn(line) >= layoutInfo.viewportColumn + 2) { // Subtract 1 because the first line should not count as a wrapped line numberWrappedLines += Math.ceil(editorWidgetModel.getLineMaxColumn(line) / layoutInfo.viewportColumn) - 1; } diff --git a/src/sql/workbench/parts/notebook/browser/cellViews/code.component.ts b/src/sql/workbench/parts/notebook/browser/cellViews/code.component.ts index ae821fcc88..361234e04a 100644 --- a/src/sql/workbench/parts/notebook/browser/cellViews/code.component.ts +++ b/src/sql/workbench/parts/notebook/browser/cellViews/code.component.ts @@ -176,10 +176,6 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange })); } - ngAfterViewInit(): void { - this._layoutEmitter.fire(); - } - get model(): NotebookModel { return this._model; } @@ -225,8 +221,6 @@ export class CodeComponent extends AngularDisposable implements OnInit, OnChange this.cellModel.source = this._editorModel.getValue(); this.onContentChanged.emit(); this.checkForLanguageMagics(); - // TODO see if there's a better way to handle reassessing size. - setTimeout(() => this._layoutEmitter.fire(), 250); })); this._register(this._configurationService.onDidChangeConfiguration(e => { if (e.affectsConfiguration('editor.wordWrap') || e.affectsConfiguration('editor.fontSize')) {