Skip to content

Commit 5c302ab

Browse files
committed
123
1 parent af2462f commit 5c302ab

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ export class SvgGenerationService {
431431
for (let lineIndex = 0; lineIndex < originalCode.length; lineIndex++) {
432432
const line = originalCode[lineIndex]
433433

434+
/**
435+
* If [line] is an empty line or only contains whitespace char, [diffWordsWithSpace] will say it's not an "remove", i.e. [part.removed] will be undefined,
436+
* therefore the deletion will not be highlighted. Thus fallback this scenario to highlight the entire line
437+
*/
434438
// If line exists in modifiedLines as a key, process character diffs
435439
if (Array.from(modifiedLines.keys()).includes(line) && line.trim().length > 0) {
436440
const modifiedLine = modifiedLines.get(line)!
@@ -455,7 +459,7 @@ export class SvgGenerationService {
455459
originalRanges.push({
456460
line: lineIndex,
457461
start: 0,
458-
end: line.length ?? 30,
462+
end: line.length ?? 4,
459463
})
460464
}
461465
}

0 commit comments

Comments
 (0)