feat(coding-agent): no warning necessary for move

- Modified no-op detection logic to allow move-only operations with unchanged content.
This commit is contained in:
can1357
2026-02-26 11:04:42 +01:00
parent 4bf357ec44
commit 6c42ad43b7
4 changed files with 64 additions and 7 deletions
+3 -3
View File
@@ -386,10 +386,10 @@ export async function computePatchDiff(
* Used for preview rendering in the TUI before hashline-mode edits execute.
*/
export async function computeHashlineDiff(
input: { path: string; edits: HashlineEdit[] },
input: { path: string; edits: HashlineEdit[]; move?: string },
cwd: string,
): Promise<DiffResult | DiffError> {
const { path, edits } = input;
const { path, edits, move } = input;
const absolutePath = resolveToCwd(path, cwd);
try {
@@ -414,7 +414,7 @@ export async function computeHashlineDiff(
const normalizedContent = normalizeToLF(content);
const result = applyHashlineEdits(normalizedContent, edits);
if (normalizedContent === result.lines) {
if (normalizedContent === result.lines && !move) {
return { error: `No changes would be made to ${path}. The edits produce identical content.` };
}