mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-23 12:37:09 +00:00
Sometimes the action log would not auto-accept deleted hunks, and I
finally found a repro for this, here's an explanation of what went wrong
```rust
// Before
use crate::{Alpha, Beta};
fn keep() {
work();
}
fn remove() {
work();
}
fn after() {
work();
}
```
```rust
// After commit
use crate::{Alpha};
fn keep() {
work();
}
fn after() {
work();
}
```
The action log may track the deletion as:
```diff
fn keep() {
work();
}
-fn remove() {
- work();
-}
-
fn after() {
work();
}
```
But the commit diff may choose different boundaries because nearby lines
repeat:
```diff
fn keep() {
work();
-}
-
-fn remove() {
- work();
}
fn after() {
work();
}
```
Both diffs produce the same final file, but their row ranges differ. The
previous logic only accepted committed edits when those row ranges
matched exactly, so already-committed edits could remain marked as
unaccepted.
Now we have a fast path for checking if the base_text matches exactly,
which works fine in this case.
Release Notes:
- Fixed an issue where agent edits would sometimes not get auto-accepted
when they were commited
|
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||