Compare files, folders, entities & text¶
Understand has a built-in side-by-side Compare view for quick, ad-hoc diffs — no external diff tool needed. You can compare two files, two folders, two entities, or arbitrary text you paste in.
This is the pairwise diff, not project comparison
This page covers the ad-hoc Compare tools. To diff two whole versions of a project (added/removed entities, metric deltas, a Git baseline), see Compare two versions of a project.
Launch a comparison¶
Everything lives on the top-level Compare menu:
| Menu item | Compares |
|---|---|
| Compare Files/Folders… | Two files, or two folders. |
| Compare Entities | Two entities in the current project. |
| Compare Arbitrary Text… | Two blocks of text you type or paste. |
Compare Files/Folders… opens a small dialog to pick the two paths — the left picker is labelled Choose source to compare and the right Choose target to compare, with a swap button between them and an OK button labelled Compare. The two sides must be the same type (both files or both folders).
Compare from a right-click¶
You can also build a comparison from selections, without typing paths. Right-click a file, folder, or entity (in the Project browser, a list, or the editor) → Compare, then:
- On the first item choose Set as Left File/Folder Comparison (or …Entity… / …Text…).
- On the second item choose the matching Set as Right … Comparison.
- Run Compare Files/Folders Fast (or Compare Entities / Compare Arbitrary Text…), which uses the two sides you just set.
Selecting text and choosing Set as Left/Right Text Comparison lets you compare two snippets from anywhere in your code.
The side-by-side diff view¶
The comparison opens as a tabbed window with the two versions side by side:
- Left / right panes with labels showing each side's name and full path.
- Change highlighting — each differing hunk is drawn as a connecting block between the panes, and changed words within a line are highlighted so small edits stand out.
- Radar scrollbar — the overview bar on the right marks the position and colour of every difference so you can see the whole file's churn at a glance.
- Synchronized scrolling — both panes scroll together, aligned on corresponding lines.
- A difference counter (e.g.
3/12) showing the current and total number of differences.
Move between changes¶
| Action | Shortcut |
|---|---|
| Next Difference | Alt+N |
| Previous Difference | Alt+P |
When you compare folders, or step through a file's Git history, Next View / Previous View move between files or commits.
Merge and edit¶
Whether you can edit and merge depends on what's being compared. When the right side is an editable document — a file or arbitrary text — the right pane is editable and the diff re-computes live as you type, and the toolbar offers Merge Selected (copy the selected difference to the right side), Merge All, and then Save, Save As…, or Save Left As…, making Compare a lightweight merge tool. Read-only comparisons show the diff without those controls.
Diff options¶
The toolbar Options menu tunes how differences are computed and shown (settings persist):
- Case Insensitive — ignore case when comparing.
- Skip Whitespace — ignore whitespace-only differences.
- Files are Unicode — treat the files as text rather than binary.
- Highlight Different Words — turn word-level highlighting on/off.
- Different Word Color / Highlight Color — pick the highlight colours.
Comparing folders¶
Compare Files/Folders… with two folders opens a folder diff: a tree of files annotated with which ones differ, were added, or removed. Rescan re-runs the comparison, Expand All / Collapse All manage the tree, and the Copy button (Copy/Merge) with its to the left… / to the right… items copies a file from one side to the other. Double-click any differing file to open the file-level side-by-side diff.
Comparing entities¶
Compare Entities opens the Compare Entities chooser, which lists the entities in the current project; pick a left and a right entity and Understand diffs their source side by side. The chooser only offers entities from the open project. The entity diff typically opens read-only, so the merge and save controls above usually don't apply.
Comparing arbitrary text
Compare Arbitrary Text… opens an editable two-pane view (both sides editable) that re-diffs as you type — handy for pasting two log outputs, two config snippets, or two revisions of a block of code that isn't in your project.