mirror of
https://github.com/zed-industries/zed.git
synced 2026-11-27 11:02:33 +01:00
7279c76ef7
## 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