Part 3 · Advanced features / 3.4

Side-by-side comparison

F4 picks two files and shows them side by side with the differences aligned and marked, and lets you copy blocks either way. Everything is written to temporary copies first; the originals are only overwritten once you confirm.

Reading time about 14 min Audience Anyone comparing files Prerequisites 2.1 Version v1.0 ・ 2026-08-26
3.4.1

Starting a comparison

F4, then the same file dialog twice.

  1. Press F4. Row 1 says “Select left file”; the dialog works exactly as it does for opening (see 2.1.2).
  2. Choose the left-hand file. The message row says “Left selected: /etc/nginx/nginx.conf; choose the right file” and row 1 becomes “Select right file”.
  3. Choose the right-hand file. The comparison appears, with “Comparison complete: 7 difference blocks”.
The originals are not touched yet

On entry Erya copies both files into a temporary directory, and every block you copy across is written to those copies. The originals change only when you confirm (see 3.4.7). Merge as freely as you like; Esc abandons everything if you change your mind.

Two kinds of file cannot be compared
  • Large files (64 MiB and up): “Side-by-side comparison is unavailable in large-file mode to avoid loading the complete file into memory”.
  • Binary files: “Binary files cannot be compared side by side”.

Both are refused while you are still choosing, so you never reach the comparison screen.

3.4.2

Reading the screen

Half each, a rule between them, and a line-number column on both sides.

爾雅 Erya │ File comparison
Left │ nginx.conf │ Right │ nginx.conf.new
1 worker_processes 4; │ 1 worker_processes 4; 2 │ 2 3≠ keepalive_timeout 65; │ 3≠ keepalive_timeout 75; 4 gzip on; │ 4 gzip on; 5 ▶ client_max_body_size 8m;│ 5 ▶ client_max_body_size 8m; 6- access_log off; │ 7 server { │ 6 server { │ │ 7+ listen 8443 ssl;
Cursor row 5/9 Current difference 2/7 Column 1 │ Legend: highlight/▶ cursor ≠ modified - left only + right only
N next difference P previous difference Shift+→ cursor left→right Shift+← cursor right→left Ctrl+S apply Esc back
ElementWhat it is
Row 2 (hint bar)Becomes the two filenames, half the width each, with the divider aligned to the one below.
Line numbersFour digits per side, followed by two marker cells: the kind of difference and the cursor.
Blank rowsWhere one side has no counterpart. This is the alignment at work — identical lines stay opposite each other.
Status barWhich row of how many, which difference of how many, the horizontal column, then the legend.
Message rowPermanently shows the comparison keys, replaced by the result of whatever you just did.
3.4.3

The three difference markers

You never have to rely on colour alone — each kind has a symbol.

SymbolMeaningOn screen
≠Present on both sides, different contentMarked on both sides, and the differing characters within the line are highlighted more strongly
-Left side onlyMarked on the left; the right side is blank
+Right side onlyMarked on the right; the left side is blank
(blank)IdenticalNo marker

Two more markers are about position rather than difference:

  • ▶ is the cursor, shown on both sides at once — the two cursors are tied together.
  • A brightened row is the row the cursor is on.
  • Yellow line numbers mark the “current difference block”, which is where N and P stop.
Consecutive differing lines form one block

When the status bar says “Current difference 2/7”, the 7 counts blocks, not lines. Five consecutive changed lines are one block: N skips the whole thing, and copying takes it as a unit.

3.4.4

The cursor and the current difference

The single most confusing thing about this screen.

The cursor (▶)

Moved with ↑ ↓, PageUp PageDown, Home End, one row at a time, stopping on identical rows as well.

Copying a difference looks at the row the cursor is on.

The current difference (yellow numbers)

Moved with N and P, one block at a time, stopping only where there is a difference.

Jumping there moves the cursor too, so you can copy immediately afterwards.

On an identical row, nothing copies

If Shift+→ appears to do nothing and the message row says “There is no difference block to copy at the cursor”, this is why. Press N to land on a difference first.

3.4.5

Moving and scrolling

The two sides always move together.

KeyWhat it does
↑ ↓Cursor one row, with the view following
PageUp PageDownA page at a time
Home EndTo the very start or end of the comparison
← →Scrolls both sides horizontally, for long lines
Ctrl+← Ctrl+→Horizontally, eight columns at a time
NNext difference block
PPrevious difference block

N and P wrap around past the last block, so you can keep pressing to circle the whole file.

3.4.6

Copying a difference across

Two keys, and the arrow points the way it goes.

KeyWhat it does
Shift+→Copies the block at the cursor from left to right (into the right temporary file)
Shift+←Copies the block at the cursor from right to left
  • Afterwards: “Current difference copied from left to the right temporary file; 6 blocks remain” — it tells you how many are left.
  • The cursor and the view stay where they are, so you can check the result. Press N when you want the next one.
  • The whole block is copied, not one line of it.
  • If writing the temporary file fails (a full disk, permissions) you get “Could not update the temporary file: …”.
The standard merge loop

N to a difference → look at it → Shift+→ or Shift+← to take it, or N again to leave it → carry on until it wraps → Ctrl+S to apply. Four keys, start to finish.

3.4.7

Applying to the originals

Press the save key of your profile (Ctrl+S by default), then answer Y or N.

Overwrite the original files with the temporary comparison results? Y overwrite / N cancel
  1. Press Ctrl+S. With nothing copied yet you simply get “There are no temporary changes to apply”, and no question.
  2. Press Y to confirm. Erya first checks whether the originals changed externally, and only then writes.
  3. Success. “Confirmed and overwritten 2 original files” — only the side you actually changed is written.
  4. Failure. “Original files were not overwritten: …”, and neither side is touched. Usually this means someone else moved an original while you were merging.
  5. Press N to cancel. “Overwrite cancelled; temporary changes are still available” — your merging survives, so you can continue or apply later.
The external check is not optional

It is the same protection as an ordinary save (see 2.1.7). Comparisons take a while, and having an original replaced by git checkout halfway through is entirely normal — Erya will not quietly write over that.

3.4.8

Three choices on the way out

With unapplied changes, Esc asks first.

Temporary changes are not applied: Y overwrite and exit / N discard and exit / Esc return
KeyResult
YOverwrite the originals and leave (with the same external check).
NDiscard the temporary changes and leave. Nothing you copied counts; the originals are untouched.
EscBack to the comparison, nothing done.

With no temporary changes at all, Esc just leaves without asking.

The temporary copies are deleted on the way out

The temporary directory exists only for the duration of the comparison. After you leave with N, the merging cannot be recovered — but the originals are still there, so starting again costs nothing but time.

3.4.9

Common problems

Seven situations in the comparison view.

SymptomCause and fix
Shift+→ does nothingThe cursor is on an identical row. Press N first (3.4.4).
Refused while choosing filesA large or binary file was selected (3.4.1).
Merged, but the originals are unchangedYou edited the temporary copies. Press Ctrl+S and confirm with Y (3.4.7).
“Original files were not overwritten”An original changed externally during the comparison. Leave and start again (3.4.7).
The merging disappeared after exitingN was pressed on the way out — discard and exit (3.4.8).
The end of a long line is off screenScroll with ← →; both sides move together (3.4.5).
The difference count looks wrongIt counts blocks, not lines; consecutive changes are one block (3.4.3).