Files
zed/crates/multi_buffer
Parker Loflin 7279c76ef7 editor: Remove dead code and redundant checks (#67217)
## Summary

Removes unused code and redundant work. No behavior changes.

- Removes about 20 unused items. Examples: `HunkAddedColor` and
`HunkRemovedColor`, `FoldStatus`, `restore_diff_hunks_in_ranges`, and
two `EditorTestContext` helpers.
- Nothing called `disable_indent_guides_for_buffer`, so
`buffers_with_disabled_indent_guides` was always empty. Removes it, and
the lookup that ran for every indent guide.
- `Autoscroll::bottom_relative` was the only constructor of
`AutoscrollStrategy::BottomRelative`. Removes both.
- `SplitEditorState::left_ratio` and `cached_width` were written but
never read.
- Removes `cx.notify()` after `remove_blocks`,
`toggle_git_blame_inline_internal`, `request_autoscroll`,
`highlight_background` and `select_entry`, which always notify.
- Removes redundant checks and repeated work:
- an `edits.is_empty()` early return, already covered by the
`edits.first()` let-else that follows it
  - an `is_empty` check before `CreaseMap::remove`
  - a re-check of an `Option` in hover popovers
  - a second identical `anchor_after` call
  - a second identical buffer snapshot
- `multi_buffer`: removes `BufferOffsetUtf16`, `should_expand_up`,
`should_expand_down`, `path_for_anchor`, unused lifetimes, and a `cfg`
that the enclosing impl already applies.

## Testing

- `./script/clippy`
- `cargo test -p editor -p multi_buffer -p outline_panel`

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- N/A
2026-11-19 23:44:25 +00:00
..