src/vs/workbench/browser/parts/editor/textDiffEditor.ts/TextDiffEditor/retrieveTextDiffEditorViewState
class TextDiffEditor:	private retrieveTextDiffEditorViewState(resource: URI): IDiffEditorViewState | null {
		const control = assertIsDefined(this.getControl());
		const model = control.getModel();
		if (!model || !model.modified || !model.original) {
			return null; // view state always needs a model
		}

		const modelUri = this.toDiffEditorViewStateResource(model);
		if (!modelUri) {
			return null; // model URI is needed to make sure we save the view state correctly
		}

		if (!isEqual(modelUri, resource)) {
			return null; // prevent saving view state for a model that is not the expected one
		}

		return control.saveViewState();
	}