mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 03:24:42 -07:00
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:
committed by
N. Taylor Mullen
parent
8440b971f5
commit
70d469ccd3
@@ -24,6 +24,7 @@ import {
|
||||
ensureCorrectFileContent,
|
||||
} from '../utils/editCorrector.js';
|
||||
import { GeminiClient } from '../core/client.js';
|
||||
import { DEFAULT_DIFF_OPTIONS } from './diffOptions.js';
|
||||
|
||||
/**
|
||||
* Parameters for the WriteFile tool
|
||||
@@ -173,7 +174,7 @@ export class WriteFileTool extends BaseTool<WriteFileToolParams, ToolResult> {
|
||||
correctedContent, // Content after potential correction
|
||||
'Current',
|
||||
'Proposed',
|
||||
{ context: 3 },
|
||||
DEFAULT_DIFF_OPTIONS,
|
||||
);
|
||||
|
||||
const confirmationDetails: ToolEditConfirmationDetails = {
|
||||
@@ -251,7 +252,7 @@ export class WriteFileTool extends BaseTool<WriteFileToolParams, ToolResult> {
|
||||
fileContent,
|
||||
'Original',
|
||||
'Written',
|
||||
{ context: 3 },
|
||||
DEFAULT_DIFF_OPTIONS,
|
||||
);
|
||||
|
||||
const llmSuccessMessage = isNewFile
|
||||
|
||||
Reference in New Issue
Block a user