Skip to content

Commit edbcf2c

Browse files
committed
enable feature flag
1 parent a805e9d commit edbcf2c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

packages/amazonq/src/app/inline/EditRendering/displayImage.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ export class EditDecorationManager {
100100
onAccept: () => void,
101101
onReject: () => void,
102102
originalCode: string,
103-
newCode: string
103+
newCode: string,
104+
removedHighlights?: vscode.DecorationOptions[]
104105
): void {
105106
// Clear any existing decorations
106107
this.clearDecorations(editor)
@@ -123,8 +124,13 @@ export class EditDecorationManager {
123124
// Apply image decoration
124125
editor.setDecorations(this.imageDecorationType, [this.currentImageDecoration])
125126

126-
// Highlight removed lines with red background
127-
this.currentRemovedCodeDecorations = this.highlightRemovedLines(editor, originalCode, newCode)
127+
// Highlight removed parts with red background - use provided highlights if available
128+
if (removedHighlights && removedHighlights.length > 0) {
129+
this.currentRemovedCodeDecorations = removedHighlights
130+
} else {
131+
// Fall back to line-level highlights if no char-level highlights provided
132+
this.currentRemovedCodeDecorations = this.highlightRemovedLines(editor, originalCode, newCode)
133+
}
128134
editor.setDecorations(this.removedCodeDecorationType, this.currentRemovedCodeDecorations)
129135
}
130136

0 commit comments

Comments
 (0)