Fixes flashing of inline conflict marker code lenses (#168598)
parent
f2ef1cce6e
commit
741f5b480a
|
@ -85,11 +85,12 @@ export default class MergeConflictCodeLensProvider implements vscode.CodeLensPro
|
|||
arguments: [conflict]
|
||||
};
|
||||
|
||||
const range = document.lineAt(conflict.range.start.line).range;
|
||||
items.push(
|
||||
new vscode.CodeLens(conflict.range, acceptCurrentCommand),
|
||||
new vscode.CodeLens(conflict.range.with(conflict.range.start.with({ character: conflict.range.start.character + 1 })), acceptIncomingCommand),
|
||||
new vscode.CodeLens(conflict.range.with(conflict.range.start.with({ character: conflict.range.start.character + 2 })), acceptBothCommand),
|
||||
new vscode.CodeLens(conflict.range.with(conflict.range.start.with({ character: conflict.range.start.character + 3 })), diffCommand)
|
||||
new vscode.CodeLens(range, acceptCurrentCommand),
|
||||
new vscode.CodeLens(range, acceptIncomingCommand),
|
||||
new vscode.CodeLens(range, acceptBothCommand),
|
||||
new vscode.CodeLens(range, diffCommand)
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -182,6 +182,11 @@ export class CodeLensHelper {
|
|||
}
|
||||
}
|
||||
|
||||
const codeLensDecorationOptions = ModelDecorationOptions.register({
|
||||
collapseOnReplaceEdit: true,
|
||||
description: 'codelens'
|
||||
});
|
||||
|
||||
export class CodeLensWidget {
|
||||
|
||||
private readonly _editor: IActiveCodeEditor;
|
||||
|
@ -218,7 +223,7 @@ export class CodeLensWidget {
|
|||
|
||||
helper.addDecoration({
|
||||
range: codeLensData.symbol.range,
|
||||
options: ModelDecorationOptions.EMPTY
|
||||
options: codeLensDecorationOptions
|
||||
}, id => this._decorationIds[i] = id);
|
||||
|
||||
// the range contains all lenses on this line
|
||||
|
@ -277,7 +282,7 @@ export class CodeLensWidget {
|
|||
this._data.forEach((codeLensData, i) => {
|
||||
helper.addDecoration({
|
||||
range: codeLensData.symbol.range,
|
||||
options: ModelDecorationOptions.EMPTY
|
||||
options: codeLensDecorationOptions
|
||||
}, id => this._decorationIds[i] = id);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue