Files
zed/crates/rope
Marco Mihai Condrache 1021122ea8 rope: Fix an unintentional panic (#47019)
Avoids the panic in #46974

But should be solved by using `saturating_sub` on the `start_overshoot`
calculation, ref:
https://github.com/zed-industries/zed/pull/47046#issuecomment-3762855786


https://github.com/zed-industries/zed/blob/08305fdee3964df900261decfc3509da511ff0f2/crates/rope/src/chunk.rs#L403C5-L415C6

This function gets called with PANIC = false from `slice`. But if the
offset is outside the text, `log_err_char_boundary` will still panic,
because the first `if` doesn’t bail out early.

Release Notes:

- N/A

Signed-off-by: Marco Mihai Condrache <52580954+marcocondrache@users.noreply.github.com>
2026-01-20 12:23:17 +00:00
..