SIGN IN SIGN UP

An open-source AI agent that brings the power of Grok directly into your terminal.

0 0 62 TypeScript

fix: improve diff generation and multi-line string replacement for large files (#23)

- rewrote generateDiff() to show only relevant context (3 lines before/after changes)
- fixed incorrect change counts (was showing 272 additions/removals for 1-line change)
- added fuzzy matching for multi-line string replacements to handle formatting differences
- added replaceAll parameter to replace all occurrences of a string
- added replaceLines() method for line-based editing when string matching isn't suitable
- improved hunk generation to merge nearby changes for better readability

this significantly improves the user experience when editing large files by showing
only the relevant changes instead of the entire file content in confirmation dialogs.
M
Martin Kalema committed
e662dd32f8b04380196b0d06da00b3913af8e616
Parent: 5183e4d
Committed by GitHub <noreply@github.com> on 7/22/2025, 1:32:28 PM