mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-04 17:04:04 -07:00
Fix dollar sign replacement bug in file editing (#7871)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -33,6 +33,7 @@ import type {
|
||||
ModifyContext,
|
||||
} from './modifiable-tool.js';
|
||||
import { IdeClient } from '../ide/ide-client.js';
|
||||
import { safeLiteralReplace } from '../utils/textUtils.js';
|
||||
|
||||
export function applyReplacement(
|
||||
currentContent: string | null,
|
||||
@@ -51,7 +52,9 @@ export function applyReplacement(
|
||||
if (oldString === '' && !isNewFile) {
|
||||
return currentContent;
|
||||
}
|
||||
return currentContent.replaceAll(oldString, newString);
|
||||
|
||||
// Use intelligent replacement that handles $ sequences safely
|
||||
return safeLiteralReplace(currentContent, oldString, newString);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user