# git_ui: Show full files by default in solo diffs \(\#60989\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/ba1990441dc71e852216311ec7c4e873de710117)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: ba1990441dc71e852216311ec7c4e873de710117

Requested commit: ba1990441dc71e852216311ec7c4e873de710117

Commit: ba1990441dc71e852216311ec7c4e873de710117

Tree: b2289ad37c0981d27f2fefd210b93660821ba28e

Author: Sathwik Chirivelli

Committer: GitHub

## Message

```
git_ui: Show full files by default in solo diffs (#60989)

# Objective

Make solo diff views show the full file by default while preserving an
easy way to focus on changed hunks. This addresses a recurring request
across issues and pull requests for full-file context in single-file Git
diffs.

## Solution

- Initialize the solo diff with a singleton multibuffer so the entire
file is visible on open.
- Keep the existing toolbar toggle available for switching to
changes-only excerpts.
- Use the singleton path key when replacing excerpts so toggling remains
reliable.
- Preserve Git change indicators in the scrollbar; the editor generates
those markers for singleton buffers.

## Testing

- Ran `cargo fmt -p git_ui`.
- Ran `git diff --check`.
- Ran `cargo check -p git_ui --no-default-features` successfully.
- Manually reviewed the full-file and changes-only state transitions in
`SoloDiffView`.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

Before, solo diffs opened with only changed hunks and surrounding
context. They now open with the complete file, retain Git change
indicators in the scrollbar, and can still be toggled to changes-only
from the toolbar.

---

Release Notes:

- Improved solo diffs to show the full file by default while retaining
Git change indicators in the scrollbar.
```

## Parents

- [9731561c57014f91a9e8b2dd8d1fd4ccc223714c](https://git.cafe/gitcafe/zed/commit/9731561c57014f91a9e8b2dd8d1fd4ccc223714c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/ba1990441dc71e852216311ec7c4e873de710117?format=markdown)
