Change:
Maybe even just typing in the result. Having this definitely is a point for though... Verification steps: Use the Load Merge Editor State From JSON command to load the provided JSON Go to an unresolved conflict and type in the editor Check that the conflict is resolved (the conflict counter decremented) json { "languageId": "typescript", "base": "/
--------------n Copyright (c) Microsoft Corporation. All rights reserved.n Licensed under the MIT License. See in the project root for license information.n *
-------------/nnimport { toErrorMessage } from 'vs/base/common/errorMessage';nimport { Disposable, MutableDisposable } from 'vs/base/common/lifecycle';nimport { SimpleIconLabel } from 'vs/base/browser/ui/iconLabel/simpleIconLabel';nimport { ICommandService } from 'vs/platform/commands/common/commands';nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';nimport { IStatusbarEntry, ShowTooltipCommand } from 'vs/workbench/services/statusbar/browser/statusbar';nimport { WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions';nimport { IThemeService, ThemeColor } from 'vs/platform/theme/common/themeService';nimport { isThemeColor } from 'vs/editor/common/editorCommon';nimport { addDisposableListener, EventType, hide, show, append, EventHelper } from 'vs/base/browser/dom';nimport { INotificationService } from 'vs/platform/notification/common/notification';nimport { assertIsDefined } from 'vs/base/common/types';nimport { Command } from 'vs/editor/common/languages';nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';nimport { KeyCode } from 'vs/base/common/keyCodes';nimport { renderIcon, renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';nimport { spinningLoading, syncing } from 'vs/platform/theme/common/iconRegistry';nimport { ICustomHover, setupCustomHover } from 'vs/base/browser/ui/iconLabel/iconLabelHover';nimport { isMarkdownString, markdownStringEqual } from 'vs/base/common/htmlContent';nimport { IHoverDelegate } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate';nimport { Gesture, EventType as TouchEventType } from 'vs/base/browser/touch';nnexport class StatusbarEntryItem extends Disposable {nntprivate readonly label: StatusBarCodiconLabel;nntprivate entry: IStatusbarEntry 'loading') {nttif (this.currentShowProgress !== showProgress) {ntttthis.currentShowProgress = !!showProgress;ntttthis.progressCodicon = renderIcon(showProgress === 'loading' ? spinningLoading : syncing);ntt = this.currentText;ntt}nt}nntoverride set text(text: string) {nntt// Progress: insert progress codicon as first element as neededntt// but keep it stable so that the animation does not resetnttif (this.currentShowProgress) {nnttt// Append as neededntttif (this.container.firstChild !== this.progressCodicon) {nttttthis.container.appendChild(this.progressCodicon);nttt}nnttt// Remove othersntttfor (const node of (this.container.childNodes)) {nttttif (node !== this.progressCodicon) {ntttt();ntttt}nttt}nnttt// If we have text to show, add a space to separate from progressntttlet textContent = text ?? '';ntttif (textContent) {ntttttextContent = ;nttt}nnttt// Append new elementsntttappend(this.container, ...renderLabelWithIcons(textContent));ntt}nntt// No Progress: no special handlingnttelse {ntt = text;ntt}nt}n}n", "input1": "/
--------------n Copyright (c) Microsoft Corporation. All rights reserved.n Licensed under the MIT License. See in the project root for license information.n *
-------------/nnimport { toErrorMessage } from 'vs/base/common/errorMessage';nimport { toErrorMessage2 } from 'vs/base/common/errorMessage2';nimport { Disposable, MutableDisposable } from 'vs/base/common/lifecycle';nimport { SimpleIconLabel } from 'vs/base/browser/ui/iconLabel/simpleIconLabel';nimport { ICommandService } from 'vs/platform/commands/common/commands';nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';nimport { IStatusbarEntry, ShowTooltipCommand } from 'vs/workbench/services/statusbar/browser/statusbar';nimport { WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions';nimport { IThemeService, ThemeColor } from 'vs/platform/theme/common/themeService';nimport { isThemeColor } from 'vs/editor/common/editorCommon';nimport { addDisposableListener, EventType, hide, show, append, EventHelper } from 'vs/base/browser/dom';nimport { INotificationService } from 'vs/platform/notification/common/notification';nimport { assertIsDefined } from 'vs/base/common/types';nimport { Command } from 'vs/editor/common/languages';nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';nimport { KeyCode } from 'vs/base/common/keyCodes';nimport { renderIcon, renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';nimport { spinningLoading, syncing } from 'vs/platform/theme/common/iconRegistry';nimport { ICustomHover, setupCustomHover } from 'vs/base/browser/ui/iconLabel/iconLabelHover';nimport { isMarkdownString, markdownStringEqual } from 'vs/base/common/htmlContent';nimport { IHoverDelegate } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate';nimport { Gesture, EventType as TouchEventType } from 'vs/base/browser/touch';nnexport class StatusbarEntryItem extends Disposable {nntprivate readonly label: StatusBarCodiconLabel;nntprivate entry: IStatusbarEntry 'loading') {nttif (this.currentShowProgress !== showProgress) {ntttthis.currentShowProgress = !!showProgress;ntttthis.progressCodicon = renderIcon(showProgress === 'loading' ? spinningLoading : syncing);ntt = this.currentText;ntt}nt}nntoverride set text(text: string) {nntt// Progress: insert progress codicon as first element as neededntt// but keep it stable so that the animation does not resetnttif (this.currentShowProgress) {nnttt// Append as neededntttif (this.container.firstChild !== this.progressCodicon) {nttttthis.container.appendChild(this.progressCodicon);nttt}nnttt// Remove othersntttfor (const node of (this.container.childNodes)) {nttttif (node !== this.progressCodicon) {ntttt();ntttt}nttt}nnttt// If we have text to show, add a space to separate from progressntttlet textContent = text ?? '';ntttif (textContent) {ntttttextContent = ;nttt}nnttt// Append new elementsntttappend(this.container, ...renderLabelWithIcons(textContent));ntt}nntt// No Progress: no special handlingnttelse {ntt = text;ntt}nt}n}n", "input2": "/
--------------n Copyright (c) Microsoft Corporation. All rights reserved.n Licensed under the MIT License. See in the project root for license information.n *
-------------/nnimport { toErrorMessage } from 'vs/base/common/errorMessage';nimport { Disposable, MutableDisposable } from 'vs/base/common/lifecycle';nimport { SimpleIconLabel } from 'vs/base/browser/ui/iconLabel/simpleIconLabel';nimport { ICommandService } from 'vs/platform/commands/common/commands';nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';nimport { IStatusbarEntry, ShowTooltipCommand } from 'vs/workbench/services/statusbar/browser/statusbar';nimport { WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions';nimport { IThemeService, ThemeColor } from 'vs/platform/theme/common/themeService';nimport { isThemeColor } from 'vs/editor/common/editorCommon';nimport { addDisposableListener, EventType, hide, show, append, EventHelper } from 'vs/base/browser/dom';nimport { INotificationService } from 'vs/platform/notification/common/notification';nimport { assertIsDefined } from 'vs/base/common/types';nimport { Command } from 'vs/editor/common/languages';nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';nimport { KeyCode } from 'vs/base/common/keyCodes';nimport { renderIcon, renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';nimport { spinningLoading, syncing } from 'vs/platform/theme/common/iconRegistry';nimport { ICustomHover, setupCustomHover } from 'vs/base/browser/ui/iconLabel/iconLabelHover';nimport { isMarkdownString, markdownStringEqual } from 'vs/base/common/htmlContent';nimport { IHoverDelegate } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate';nimport { Gesture, EventType as TouchEventType } from 'vs/base/browser/touch';nnexport class StatusbarEntryItem extends Disposable {nntprivate readonly label: StatusBarCodiconLabel;nntprivate entry: IStatusbarEntry 'loading') {nttif (this.currentShowProgress !== showProgress) {ntttthis.currentShowProgress = !!showProgress;ntttthis.progressCodicon = renderIcon(showProgress === 'loading' ? spinningLoading : syncing);ntt = this.currentText;ntt}nt}nntoverride set text(text: string) {nntt// Progress: insert progress codicon as first element as neededntt// but keep it stable so that the animation does not resetnttif (this.currentShowProgress) {nnttt// Append as neededntttif (this.container.firstChild !== this.progressCodicon) {nttttthis.container.appendChild(this.progressCodicon);nttt}nnttt// Remove othersntttfor (const node of (this.container.childNodes)) {nttttif (node !== this.progressCodicon) {ntttt();ntttt}nttt}nnttt// If we have text to show, add a space to separate from progressntttlet textContent = text ?? '';ntttif (textContent) {ntttttextContent = ;nttt}nnttt// Append new elementsntttappend(this.container, ...renderLabelWithIcons(textContent));ntt}nntt// No Progress: no special handlingnttelse {ntt = text;ntt}nt}n}n", "result": "/
--------------n Copyright (c) Microsoft Corporation. All rights reserved.n Licensed under the MIT License. See in the project root for license information.n *
-------------/nnimport { toErrorMessage } from 'vs/base/common/errorMessage';nimport { toErrorMessage2 } from 'vs/base/common/errorMessage2';nimport { Disposable, MutableDisposable } from 'vs/base/common/lifecycle';nimport { SimpleIconLabel } from 'vs/base/browser/ui/iconLabel/simpleIconLabel';nimport { ICommandService } from 'vs/platform/commands/common/commands';nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';nimport { IStatusbarEntry, ShowTooltipCommand } from 'vs/workbench/services/statusbar/browser/statusbar';nimport { WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions';nimport { IThemeService, ThemeColor } from 'vs/platform/theme/common/themeService';nimport { isThemeColor } from 'vs/editor/common/editorCommon';nimport { addDisposableListener, EventType, hide, show, append, EventHelper } from 'vs/base/browser/dom';nimport { INotificationService } from 'vs/platform/notification/common/notification';nimport { assertIsDefined } from 'vs/base/common/types';nimport { Command } from 'vs/editor/common/languages';nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';nimport { KeyCode } from 'vs/base/common/keyCodes';nimport { renderIcon, renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';nimport { spinningLoading, syncing } from 'vs/platform/theme/common/iconRegistry';nimport { ICustomHover, setupCustomHover } from 'vs/base/browser/ui/iconLabel/iconLabelHover';nimport { isMarkdownString, markdownStringEqual } from 'vs/base/common/htmlContent';nimport { IHoverDelegate } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate';nimport { Gesture, EventType as TouchEventType } from 'vs/base/browser/touch';nnexport class StatusbarEntryItem extends Disposable {nntprivate readonly label: StatusBarCodiconLabel;nntprivate entry: IStatusbarEntry 'loading') {nttif (this.currentShowProgress !== showProgress) {ntttthis.currentShowProgress = !!showProgress;ntttthis.progressCodicon = renderIcon(showProgress === 'loading' ? spinningLoading : syncing);ntt = this.currentText;ntt}nt}nntoverride set text(text: string) {nntt// Progress: insert progress codicon as first element as neededntt// but keep it stable so that the animation does not resetnttif (this.currentShowProgress) {nnttt// Append as neededntttif (this.container.firstChild !== this.progressCodicon) {nttttthis.container.appendChild(this.progressCodicon);nttt}nnttt// Remove othersntttfor (const node of (this.container.childNodes)) {nttttif (node !== this.progressCodicon) {ntttt();ntttt}nttt}nnttt// If we have text to show, add a space to separate from progressntttlet textContent = text ?? '';ntttif (textContent) {ntttttextContent = ;nttt}nnttt// Append new elementsntttappend(this.container, ...renderLabelWithIcons(textContent));ntt}nntt// No Progress: no special handlingnttelse {ntt = text;ntt}nt}n}n", "initialResult": "/
--------------n Copyright (c) Microsoft Corporation. All rights reserved.n Licensed under the MIT License. See in the project root for license information.n *
-------------/nnimport { toErrorMessage } from 'vs/base/common/errorMessage';nimport { Disposable, MutableDisposable } from 'vs/base/common/lifecycle';nimport { SimpleIconLabel } from 'vs/base/browser/ui/iconLabel/simpleIconLabel';nimport { ICommandService } from 'vs/platform/commands/common/commands';nimport { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';nimport { IStatusbarEntry, ShowTooltipCommand } from 'vs/workbench/services/statusbar/browser/statusbar';nimport { WorkbenchActionExecutedEvent, WorkbenchActionExecutedClassification } from 'vs/base/common/actions';nimport { IThemeService, ThemeColor } from 'vs/platform/theme/common/themeService';nimport { isThemeColor } from 'vs/editor/common/editorCommon';nimport { addDisposableListener, EventType, hide, show, append, EventHelper } from 'vs/base/browser/dom';nimport { INotificationService } from 'vs/platform/notification/common/notification';nimport { assertIsDefined } from 'vs/base/common/types';nimport { Command } from 'vs/editor/common/languages';nimport { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';nimport { KeyCode } from 'vs/base/common/keyCodes';nimport { renderIcon, renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';nimport { spinningLoading, syncing } from 'vs/platform/theme/common/iconRegistry';nimport { ICustomHover, setupCustomHover } from 'vs/base/browser/ui/iconLabel/iconLabelHover';nimport { isMarkdownString, markdownStringEqual } from 'vs/base/common/htmlContent';nimport { IHoverDelegate } from 'vs/base/browser/ui/iconLabel/iconHoverDelegate';nimport { Gesture, EventType as TouchEventType } from 'vs/base/browser/touch';nnexport class StatusbarEntryItem extends Disposable {nntprivate readonly label: StatusBarCodiconLabel;nntprivate entry: IStatusbarEntry 'loading') {nttif (this.currentShowProgress !== showProgress) {ntttthis.currentShowProgress = !!showProgress;ntttthis.progressCodicon = renderIcon(showProgress === 'loading' ? spinningLoading : syncing);ntt = this.currentText;ntt}nt}nntoverride set text(text: string) {nntt// Progress: insert progress codicon as first element as neededntt// but keep it stable so that the animation does not resetnttif (this.currentShowProgress) {nnttt// Append as neededntttif (this.container.firstChild !== this.progressCodicon) {nttttthis.container.appendChild(this.progressCodicon);nttt}nnttt// Remove othersntttfor (const node of (this.container.childNodes)) {nttttif (node !== this.progressCodicon) {ntttt();ntttt}nttt}nnttt// If we have text to show, add a space to separate from progressntttlet textContent = text ?? '';ntttif (textContent) {ntttttextContent = ;nttt}nnttt// Append new elementsntttappend(this.container, ...renderLabelWithIcons(textContent));ntt}nntt// No Progress: no special handlingnttelse {ntt = text;ntt}nt}n}n" }

Discussion:
return map.projectRange(range).outputRange; } <ins> public findModifiedBaseRangesInRange(rangeInBase: LineRange): ModifiedBaseRange[] { // TODO use binary search return this.modifiedBaseRanges.get().filter(r => r.baseRange.intersects(rangeInBase)); } </ins> public readonly diffComputingState = derived('diffComputingState', reader => { const states = [ this.input1TextModelDiffs,

const viewModel = new MergeEditorViewModel(model, this.input1View, this.input2View, this.inputResultView, this.baseView); this._viewModel.set(viewModel, undefined); <ins> this._sessionDisposables.add(viewModel); </ins> // Set/unset context keys based on input this._ctxResultUri.set(model.resultTextModel.uri.toString());

*--------------------------------------------------------------------------------------------*/ import { findLast } from 'vs/base/common/arrays'; <ins> import { Disposable } from 'vs/base/common/lifecycle'; </ins> import { derived, derivedObservableWithWritableCache, IObservable, IReader, ITransaction, observableValue, transaction } from 'vs/base/common/observable'; <ins> import { Range } from 'vs/editor/common/core/range'; </ins> import { ScrollType } from 'vs/editor/common/editorCommon'; import { LineRange } from 'vs/workbench/contrib/mergeEditor/browser/model/lineRange'; import { MergeEditorModel } from 'vs/workbench/contrib/mergeEditor/browser/model/mergeEditorModel';

import { InputCodeEditorView } from 'vs/workbench/contrib/mergeEditor/browser/view/editors/inputCodeEditorView'; import { ResultCodeEditorView } from 'vs/workbench/contrib/mergeEditor/browser/view/editors/resultCodeEditorView'; <del> export class MergeEditorViewModel { </del> <ins> export class MergeEditorViewModel extends Disposable { </ins> private readonly manuallySetActiveModifiedBaseRange = observableValue< { range: ModifiedBaseRange | undefined; counter: number } >('manuallySetActiveModifiedBaseRange', { range: undefined, counter: 0 });

public readonly inputCodeEditorView2: InputCodeEditorView, public readonly resultCodeEditorView: ResultCodeEditorView, public readonly baseCodeEditorView: IObservable<BaseCodeEditorView | undefined>, <del> ) { } </del> <ins> ) { super(); this._register(resultCodeEditorView.editor.onDidChangeModelContent(e => { transaction(tx => { /** @description Mark conflicts touched by manual edits as handled */ for (const change of e.changes) { const rangeInBase = this.model.translateResultRangeToBase(Range.lift(change.range)); const baseRanges = this.model.findModifiedBaseRangesInRange(new LineRange(rangeInBase.startLineNumber, rangeInBase.endLineNumber - rangeInBase.startLineNumber)); if (baseRanges.length === 1) { this.model.setHandled(baseRanges[0], true, tx); } } }); })); } </ins> private counter = 0; private readonly lastFocusedEditor = derivedObservableWithWritableCache<