Skip to content

Commit f0f6330

Browse files
committed
Ignore whitespace differences when calculating diff statistics
- it's been reported that dropping try/catch wrapping counts lines as whole section got replaced, but we should see just e.g. 4 lines removed └── apps └── editor └── src └── commands └── apply-response-command └── utils └── preview ├── diff-utils.ts ├── file-preparer.ts └── workspace-listener.ts
1 parent 19b1ac2 commit f0f6330

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • apps/editor/src/commands/apply-response-command/utils/preview

‎apps/editor/src/commands/apply-response-command/utils/preview/diff-utils.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export const get_diff_stats = (params: {
1414
return { lines_added: 0, lines_removed: 0 }
1515
}
1616

17-
const changes = diffLines(original_content_processed, new_content_processed)
17+
const changes = diffLines(original_content_processed, new_content_processed, {
18+
ignoreWhitespace: true
19+
})
1820

1921
let lines_added = 0
2022
let lines_removed = 0

0 commit comments

Comments
 (0)