You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.**Faster File Editing**: Roo modifies files more quickly by applying only the necessary changes.
18
19
2.**Prevents Truncated Writes**: The system automatically detects and rejects attempts by the AI to write incomplete file content, which can happen with large files or complex instructions. This helps prevent corrupted files.
19
20
20
21
:::note Disabling Fast Edits
21
22
If you uncheck **Enable editing through diffs**, Roo will revert to writing the entire file content for every edit using the [`write_to_file`](/features/tools/write-to-file) tool, instead of applying targeted changes with [`apply_diff`](/features/tools/apply-diff). This full-write approach is generally slower for modifying existing files and leads to higher token usage.
22
23
:::
23
24
24
-
## Diff Strategy
25
-
26
-
This setting determines the method Roo uses to calculate and apply changes:
27
-
28
-
***Multi-block diff** (Default since v3.11): Allows updating multiple, separate code blocks within the same file in a single operation. More efficient for widespread changes. (Uses `MultiSearchReplaceDiffStrategy` internally).
29
-
***Single block**: Applies changes to one code block at a time. Reliable for most common edits. (Uses `SearchReplaceDiffStrategy` internally).
30
-
***Unified diff**: A more sophisticated strategy that analyzes the changes and selects the best approach, potentially using different matching techniques. (Uses `NewUnifiedDiffStrategy` internally).
31
-
32
-
Choose the strategy that best suits the complexity of the edits you typically perform. The experimental options offer potential efficiency gains but may behave differently.
33
-
34
25
## Match Precision
35
26
36
27
This slider controls how closely the code sections identified by the AI must match the actual code in your file before a change is applied.
37
28
29
+
<img src="/img/fast-edits/fast-edits-4.png" alt="Roo Code settings showing Enable editing through diffs checkbox and Match precision slider" width="500" />
30
+
38
31
***100% (Default)**: Requires an exact match. This is the safest option, minimizing the risk of incorrect changes.
39
32
***Lower Values (80%-99%)**: Allows for "fuzzy" matching. Roo can apply changes even if the code section has minor differences from what the AI expected. This can be useful if the file has been slightly modified, but **increases the risk** of applying changes in the wrong place.
40
33
41
34
**Use values below 100% with extreme caution.** Lower precision might be necessary occasionally, but always review the proposed changes carefully.
42
35
43
36
Internally, this setting adjusts a `fuzzyMatchThreshold` used with algorithms like Levenshtein distance to compare code similarity.
44
37
45
-
## Model Recommendation
46
38
47
-
The setting description notes that diff-based editing "Works best with the latest Claude 3.7 Sonnet model." This is likely because newer, more capable models can generate the precise diff formats required for this feature more reliably.
39
+
## Experimental Features
40
+
41
+
Under the "Experimental Features" section, you will find this option:
42
+
43
+
<img src="/img/fast-edits/fast-edits-2.png" alt="Roo Code settings showing the Experimental Features section with the experimental unified diff strategy checkbox" width="500" />
44
+
45
+
***Use experimental unified diff strategy**: This checkbox might appear to enable specific variations or optimizations of the `UnifiedDiffStrategy`. Enabling this could potentially reduce retries caused by model errors but might also introduce unexpected behavior or incorrect edits. Enable only if you understand the risks and are prepared to carefully review all changes.
0 commit comments