From 0d004b5c77498c3a212a56ee417517e917f744af Mon Sep 17 00:00:00 2001 From: Daniel Riccio Date: Fri, 10 Jan 2025 17:35:22 -0500 Subject: [PATCH] refactor: increase context lines in NewUnifiedDiffStrategy - Updated the maximum context lines from 3 to 6 in the parseUnifiedDiff method to provide more context around changes. --- src/core/diff/strategies/new-unified/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/diff/strategies/new-unified/index.ts b/src/core/diff/strategies/new-unified/index.ts index 6f2b62f..17b5b3f 100644 --- a/src/core/diff/strategies/new-unified/index.ts +++ b/src/core/diff/strategies/new-unified/index.ts @@ -5,7 +5,7 @@ import { DiffResult, DiffStrategy } from "../../types" export class NewUnifiedDiffStrategy implements DiffStrategy { private parseUnifiedDiff(diff: string): Diff { - const MAX_CONTEXT_LINES = 3; // Number of context lines to keep before/after changes + const MAX_CONTEXT_LINES = 6; // Number of context lines to keep before/after changes const lines = diff.split('\n'); const hunks: Hunk[] = []; let currentHunk: Hunk | null = null; @@ -49,9 +49,7 @@ export class NewUnifiedDiffStrategy implements DiffStrategy { continue; } - if (!currentHunk) { - continue; - } + if (!currentHunk) {continue}; // Extract the complete indentation for each line const content = line.slice(1); // Remove the diff marker