mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
Fixes edge case (#158888)
This commit is contained in:
parent
d5a59298e2
commit
9628fab4f8
3 changed files with 7 additions and 1 deletions
|
@ -334,6 +334,10 @@ export class MergeEditorModel extends EditorModel {
|
||||||
return ModifiedBaseRangeState.conflicting;
|
return ModifiedBaseRangeState.conflicting;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public has(baseRange: ModifiedBaseRange): boolean {
|
||||||
|
return this.modifiedBaseRangeHandlingStateStores.get().has(baseRange);
|
||||||
|
}
|
||||||
|
|
||||||
public isHandled(baseRange: ModifiedBaseRange): IObservable<boolean> {
|
public isHandled(baseRange: ModifiedBaseRange): IObservable<boolean> {
|
||||||
return this.modifiedBaseRangeHandlingStateStores.get().get(baseRange)!;
|
return this.modifiedBaseRangeHandlingStateStores.get().get(baseRange)!;
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,6 @@ export class ModifiedBaseRange {
|
||||||
public readonly input1CombinedDiff = DetailedLineRangeMapping.join(this.input1Diffs);
|
public readonly input1CombinedDiff = DetailedLineRangeMapping.join(this.input1Diffs);
|
||||||
public readonly input2CombinedDiff = DetailedLineRangeMapping.join(this.input2Diffs);
|
public readonly input2CombinedDiff = DetailedLineRangeMapping.join(this.input2Diffs);
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public readonly baseRange: LineRange,
|
public readonly baseRange: LineRange,
|
||||||
public readonly baseTextModel: ITextModel,
|
public readonly baseTextModel: ITextModel,
|
||||||
|
|
|
@ -131,6 +131,9 @@ export class InputCodeEditorView extends CodeEditorView {
|
||||||
className: derived('checkbox classnames', (reader) => {
|
className: derived('checkbox classnames', (reader) => {
|
||||||
const classNames = [];
|
const classNames = [];
|
||||||
const active = viewModel.activeModifiedBaseRange.read(reader);
|
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);
|
const isHandled = model.isHandled(baseRange).read(reader);
|
||||||
if (isHandled) {
|
if (isHandled) {
|
||||||
classNames.push('handled');
|
classNames.push('handled');
|
||||||
|
|
Loading…
Reference in a new issue