Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes edge case #158888

Merged
merged 1 commit into from Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -334,6 +334,10 @@ export class MergeEditorModel extends EditorModel {
return ModifiedBaseRangeState.conflicting;
}

public has(baseRange: ModifiedBaseRange): boolean {
return this.modifiedBaseRangeHandlingStateStores.get().has(baseRange);
}

public isHandled(baseRange: ModifiedBaseRange): IObservable<boolean> {
return this.modifiedBaseRangeHandlingStateStores.get().get(baseRange)!;
}
Expand Down
Expand Up @@ -48,7 +48,6 @@ export class ModifiedBaseRange {
public readonly input1CombinedDiff = DetailedLineRangeMapping.join(this.input1Diffs);
public readonly input2CombinedDiff = DetailedLineRangeMapping.join(this.input2Diffs);


constructor(
public readonly baseRange: LineRange,
public readonly baseTextModel: ITextModel,
Expand Down
Expand Up @@ -131,6 +131,9 @@ export class InputCodeEditorView extends CodeEditorView {
className: derived('checkbox classnames', (reader) => {
const classNames = [];
const active = viewModel.activeModifiedBaseRange.read(reader);
if (!model.has(baseRange)) {
return ''; // Invalid state, should only be observed temporarily
}
const isHandled = model.isHandled(baseRange).read(reader);
if (isHandled) {
classNames.push('handled');
Expand Down