diff --git a/src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component.ts b/src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component.ts index d4d8b655d7..decc9b2249 100644 --- a/src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component.ts +++ b/src/sql/workbench/parts/notebook/electron-browser/cellViews/textCell.component.ts @@ -164,10 +164,12 @@ export class TextCellComponent extends CellView implements OnInit, OnChanges { */ private updatePreview(): void { let trustedChanged = this.cellModel && this._lastTrustedMode !== this.cellModel.trustedMode; - let contentChanged = this._content !== this.cellModel.source || this.cellModel.source.length === 0; + let cellModelSourceJoined = Array.isArray(this.cellModel.source) ? this.cellModel.source.join('') : this.cellModel.source; + let contentJoined = Array.isArray(this._content) ? this._content.join('') : this._content; + let contentChanged = contentJoined !== cellModelSourceJoined || cellModelSourceJoined.length === 0; if (trustedChanged || contentChanged) { this._lastTrustedMode = this.cellModel.trustedMode; - if (!this.cellModel.source && !this.isEditMode) { + if ((!cellModelSourceJoined) && !this.isEditMode) { this._content = localize('doubleClickEdit', "Double-click to edit"); } else { this._content = this.cellModel.source;