zed/crates/action_log
Bennet Bo Fenner 1fb920775b
action_log: Accept deleted hunks after commit (#56892)
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
2026-05-15 16:27:14 +00:00
..
src action_log: Accept deleted hunks after commit (#56892) 2026-05-15 16:27:14 +00:00
Cargo.toml action_log: Accept deleted hunks after commit (#56892) 2026-05-15 16:27:14 +00:00
LICENSE-GPL Pull action_log into its own crate (#35959) 2025-08-10 21:57:55 +00:00