| 194 | /// * `gap` - Maximum gap (in lines) to allow between changes |
| 195 | #[must_use] |
| 196 | pub fn can_combine_with(&self, other: &Self, gap: usize) -> bool { |
| 197 | // Check if changes are close enough in the old file |
| 198 | let self_old_end = self.old_start + self.old_len; |
| 199 | let other_old_start = other.old_start; |
| 200 | |
| 201 | if other_old_start > self_old_end { |
| 202 | other_old_start - self_old_end <= gap |
| 203 | } else { |
| 204 | // Overlapping or adjacent |
| 205 | true |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | /// Combine this change with another, producing a merged change. |
| 210 | /// |