Fix(diff): Hide whitespace changes in diffs with content changes

- Updated the diff generation in `edit.ts` and `write-file.ts` to include the `ignoreWhitespace: true` option.
- This ensures that whitespace-only changes are not highlighted in the diff output when there are other content modifications, making the diffs cleaner and easier to review.
- Extract default diffing options into single source of truth.

Fixes https://github.com/google-gemini/gemini-cli/issues/548
This commit is contained in:
Taylor Mullen
2025-05-25 22:38:44 -07:00
committed by N. Taylor Mullen
parent 8440b971f5
commit 70d469ccd3
3 changed files with 18 additions and 4 deletions

View File

@@ -0,0 +1,12 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as Diff from 'diff';
export const DEFAULT_DIFF_OPTIONS: Diff.PatchOptions = {
context: 3,
ignoreWhitespace: true,
};