Diff view
You can use the Diff view to compare file versions with syntax highlighting, linked scrolling, and change navigation.
Navigate the Diff view
To open a file in the Diff view, click the file in Staging. You can also access the Diff view when viewing commits or branch comparisons.
The following table describes each icon in the Diff view header.
| Icon | Action |
|---|---|
| Side-by-side view | Switches the current view to Side-by-side view. |
| Unified view | Switches the current view to Unified view. |
| Rendered view | Switches the current view to Rendered view. Disabled for a file that has no rendered form. |
| Working file view | Shows the file as it is on disk, read only. Available only for conflicted text files. |
| Toggle context collapse | Auto-collapses long regions of unchanged code |
| Toggle word wrap | Wraps long lines of code. |
| Toggle scrollbar change indicators | Enables indicators on the scrollbar that show where changes are in a file. |
Click the Previous change icon and the Next change icon to navigate through changes in the file.
Renamed, moved, and copied files
The header shows the file name and the folder path that contains it. Click the file name to open the file. Click a folder to show it in the File Browser.
When a commit renames, moves, or copies a file, the header shows the changed part as before → after. Only the part that changed splits in two: a file that moved keeps one name and shows two folder paths, and a file that was renamed in place keeps one folder path and shows two names. Every folder in both paths stays clickable. The Diff view compares the two paths, so it reads the before side at the old path.
A name you can click is a file that is on disk now.
| Change | File name |
|---|---|
| Added or modified | Opens the file. |
| Deleted | Plain text, because the file is gone. |
| Renamed or moved | The before name is plain text, because that path is gone. The after name opens the file. |
| Copied | Both names open their own file, because a copy leaves the source where it was. |
Side-by-side view
Side-by-side view displays two panels side-by-side with removals on the left and additions on the right. Removals are highlighted in red and additions are highlighted in green. Scrolling is linked between panels.
Unified view
Unified view displays all changes to a file on a single panel. Removals are prefixed by - and highlighted in red. Additions are prefixed by + and highlighted in green.
Rendered view
Rendered view shows the two revisions as finished documents in two panels, with linked scrolling, so you can compare the result of the change.
It is available for these document formats:
| Format | Extensions |
|---|---|
| Markdown | .md, .markdown, .mdx, .mdown, .mkd, .mkdn, .rmd, .qmd |
| AsciiDoc | .adoc, .asciidoc, .asc |
| Org Mode | .org |
| reStructuredText | .rst, .rest |
For all other files the Rendered view icon stays in the header, disabled, because those files have no rendered form.
Rendered view is read only. It does not highlight changes or show staging controls. To stage the file, a hunk, or a line, switch to Side-by-side view or Unified view.
Zide remembers Rendered view and uses it for the next document diff you open.
Staging controls
You can stage and unstage files and hunks when you open a file in Diff view from Staging. Click Stage File to stage the entire file and Unstage File to unstage the file. Click Staged or Unstaged next to the hunk to stage or unstage that specific change.
If a hunk or line action uses an outdated diff, Zide makes no changes and reloads the Diff view. Review the diff, then try again.
For a binary file, Stage File is available unless the file is fully staged. Unstage File is available unless nothing is staged. The status shows Staged, Unstaged, or Partially staged.
Binary files
Use Preview and Hex view in the Diff tab header to switch views.
- Preview compares images, audio, and video and is the default for these file types.
- Hex view shows each version’s bytes in its own column, with linked scrolling and differing bytes highlighted. Other binary files, such as
.bin,.dat, executables, archives, and fonts, open in this view with Preview disabled.
Each tab remembers your choice.
Bytes are compared at the same offset, so inserting or removing one byte can mark all later bytes as changed. A version larger than 256 MiB shows its size instead of a hex view.
Conflicts
When you open a conflicted file from Staging, the Diff view shows the two sides below a conflict bar. For the actions in the bar, see Resolve a conflicted file.
Language servers
When viewing a working-tree diff, resting the pointer on a symbol displays its type and documentation. In Side-by-side view, hover information is available on the right panel. In Unified view, it is available on added and unchanged lines. Removed lines and diffs between committed versions do not provide hover information because the language server only knows the current working-tree file.
See Language servers for installation and settings.