continue-custom/core/edit
Matt Van Horn 9c08e5917a
fix: preserve indentation when applying code edits to Python files (#11289)
* fix: preserve indentation when applying code edits via fuzzy matching

When fallback matching strategies (trimmedMatch, whitespaceIgnoredMatch)
find a match with different indentation than the LLM-provided old_string,
the replacement new_string now has its indentation adjusted to match the
actual indentation level in the file. This fixes incorrect indentation in
Python code edits where the LLM provides unindented search/replace strings
that match indented code blocks.

Fixes #11282

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix(core): adjust indentation when fallback match strategies splice replacements

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 13:12:00 -07:00
..
lazy feat: sonnet lazy apply prompt should not change comments (#8665) 2025-11-17 11:05:22 -08:00
searchAndReplace fix: preserve indentation when applying code edits to Python files (#11289) 2026-03-24 13:12:00 -07:00
applyAbortManager.ts change to reject diffs approach rather than cancel apply approach 2025-05-29 16:04:35 -07:00
constants.ts feat: add Mercury Apply endpoint support to Inception LLM (#7827) 2025-09-18 23:44:25 -07:00
recursiveStream.ts feat: add Mercury Apply endpoint support to Inception LLM (#7827) 2025-09-18 23:44:25 -07:00
streamDiffLines.test.ts addIndentation tests 2024-12-05 23:39:20 -08:00
streamDiffLines.ts feat: add Mercury Apply endpoint support to Inception LLM (#7827) 2025-09-18 23:44:25 -07:00