File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
packages/amazonq/src/app/inline/EditRendering Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments