From 416122eff7ae5bf5fa08c7de2c4c1342c91e669b Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Thu, 14 Mar 2019 17:57:25 -0700 Subject: [PATCH] Make sure we update status values properly for empty editors Fixes #70321 --- .../browser/parts/editor/editorStatus.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/vs/workbench/browser/parts/editor/editorStatus.ts b/src/vs/workbench/browser/parts/editor/editorStatus.ts index 60538abc8db..6b74da25139 100644 --- a/src/vs/workbench/browser/parts/editor/editorStatus.ts +++ b/src/vs/workbench/browser/parts/editor/editorStatus.ts @@ -182,56 +182,56 @@ class State { const e = new StateChange(); let somethingChanged = false; - if (typeof update.selectionStatus !== 'undefined') { + if ('selectionStatus' in update) { if (this._selectionStatus !== update.selectionStatus) { this._selectionStatus = update.selectionStatus; somethingChanged = true; e.selectionStatus = true; } } - if (typeof update.indentation !== 'undefined') { + if ('indentation' in update) { if (this._indentation !== update.indentation) { this._indentation = update.indentation; somethingChanged = true; e.indentation = true; } } - if (typeof update.mode !== 'undefined') { + if ('mode' in update) { if (this._mode !== update.mode) { this._mode = update.mode; somethingChanged = true; e.mode = true; } } - if (typeof update.encoding !== 'undefined') { + if ('encoding' in update) { if (this._encoding !== update.encoding) { this._encoding = update.encoding; somethingChanged = true; e.encoding = true; } } - if (typeof update.EOL !== 'undefined') { + if ('EOL' in update) { if (this._EOL !== update.EOL) { this._EOL = update.EOL; somethingChanged = true; e.EOL = true; } } - if (typeof update.tabFocusMode !== 'undefined') { + if ('tabFocusMode' in update) { if (this._tabFocusMode !== update.tabFocusMode) { this._tabFocusMode = update.tabFocusMode; somethingChanged = true; e.tabFocusMode = true; } } - if (typeof update.screenReaderMode !== 'undefined') { + if ('screenReaderMode' in update) { if (this._screenReaderMode !== update.screenReaderMode) { this._screenReaderMode = update.screenReaderMode; somethingChanged = true; e.screenReaderMode = true; } } - if (typeof update.metadata !== 'undefined') { + if ('metadata' in update) { if (this._metadata !== update.metadata) { this._metadata = update.metadata; somethingChanged = true; -- GitLab