src/vs/workbench/contrib/files/browser/editors/textFileEditor.ts/TextFileEditor/doSaveOrClearTextEditorViewState
class TextFileEditor:	private doSaveOrClearTextEditorViewState(input: IEditorInput | undefined): void {
		if (!(input instanceof FileEditorInput)) {
			return; // ensure we have an input to handle view state for
		}

		// If the user configured to not restore view state, we clear the view
		// state unless the editor is still opened in the group.
		if (!this.shouldRestoreTextEditorViewState(input) && (!this.group || !this.group.contains(input))) {
			this.clearTextEditorViewState(input.resource, this.group);
		}

		// Otherwise we save the view state to restore it later
		else if (!input.isDisposed()) {
			this.saveTextEditorViewState(input.resource);
		}
	}