From 99c86ccddf4663bd83cb43de64ba5944aaea3b06 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 6 Jun 2023 18:13:36 -0700 Subject: [PATCH] aider: Updated diff_partial_update function to include 5 lines of context in unified_diff function call. # Context: USER: expand the context diff to 5 lines of context ASSISTANT: To expand the context diff to 5 lines of context, you need to modify the `diff_partial_update` function in the `aider/diffs.py` file. Update the `unified_diff` function call to include the `n` parameter with a value of 5. Here's the change: ```python aider/diffs.py <<<<<<< ORIGINAL diff = difflib.unified_diff(lines_orig, lines_updated) ======= diff = difflib.unified_diff(lines_orig, lines_updated, n=5) >>>>>>> UPDATED ``` --- aider/diffs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/diffs.py b/aider/diffs.py index 883a272bc..471212fc9 100644 --- a/aider/diffs.py +++ b/aider/diffs.py @@ -58,7 +58,7 @@ def diff_partial_update(lines_orig, lines_updated, final=False): if not final: lines_updated = lines_updated[:-1] + ["...\n"] - diff = difflib.unified_diff(lines_orig, lines_updated) + diff = difflib.unified_diff(lines_orig, lines_updated, n=5) diff = list(diff)[2:]