Diff Viewer
The Diff tab shows a two-panel comparison of file versions with syntax highlighting, linked scrolling, and change navigation. It opens automatically when you click a file in the Changes tab, a commit’s file list, or a branch comparison.
View Modes
Toggle between two display modes using the toolbar buttons:
- Split view — side-by-side panels with deletions on the left (red) and additions on the right (green). Scrolling is linked between panels.
- Unified view — single-column display with deletions prefixed by
-and additions by+, similar to a traditional diff output.
Navigating Changes
Use the change navigation controls in the toolbar:
| Control | Shortcut | Action |
|---|---|---|
| Previous change | N (Shift+N) or K | Jump to the previous hunk |
| Next change | N or J | Jump to the next hunk |
| Hunk indicator | — | Shows “3 of 12” style position |
The scrollbar can also display colored change indicators showing where additions and deletions are located throughout the file. Toggle this overlay with the change indicators button.
Staging Controls
When viewing changes from the Changes tab, staging controls appear in the toolbar. Two modes are available:
File Mode
- Stage — stage the entire file
- Unstage — unstage the entire file
- Discard — discard all changes in the file
Hunk Mode
- Stage/Unstage — toggle staging for the current hunk
- Stage All / Unstage All — bulk stage or unstage all hunks
- Discard — discard only the current hunk
In unified view with hunk mode, you can toggle Show Staged Diffs to see which hunks are currently staged.
Toolbar Toggles
| Toggle | Effect |
|---|---|
| Collapse context | Auto-collapse long regions of unchanged code. Click a collapsed region to expand it. |
| Word wrap | Wrap long lines instead of horizontal scrolling |
| Change indicators | Show colored markers on the scrollbar |
Binary Files
The diff viewer handles binary files with specialized previews:
- Images — side-by-side image preview (PNG, JPG, GIF, WebP, SVG, and more)
- Audio — HTML5 audio players for each version
- Video — HTML5 video players for each version
- Other binary — displays a “Binary file differs” message
Keyboard Shortcuts
| Shortcut | Action |
|---|---|
| N | Next change |
| Shift+N | Previous change |
| P | Previous change |
| J | Next change (vim-style) |
| K | Previous change (vim-style) |