Apply Changes¶
Diffract lets you copy changes from one side to the other without leaving the application. You can apply an entire changed block or a single line.
Warning
Your original files are never modified until you press Ctrl+S. All edits remain in the in-memory buffer until you explicitly save.
Block apply¶
A block is a contiguous group of changed lines bounded by unchanged lines.
When you hover over a changed block, arrow buttons appear in the gutter between the two panels:
- ◁ - copy this block from the right side to the left side
- ▷ - copy this block from the left side to the right side
The buttons appear for every changed block in the comparison. Click the arrow pointing toward the side you want to update.
Steps¶
- Scroll to a changed block (or use F7 to jump to the next one).
- Hover over the block. The ◁ and ▷ gutter buttons appear.
- Click the arrow that points toward the side you want to receive the change.
- The block on the target side is replaced with the content from the source side.
- Press Ctrl+S to save the updated file.
Single-line apply¶
To apply one specific line rather than the whole block:
- Click on the line you want to apply. A cyan highlight bar appears on that line to indicate it is selected.
- A single arrow button appears in the gutter for that line only.
- Click the arrow to copy just that line to the other side.
- Press Ctrl+S to save.
The "changed" indicator in the path bar¶
After you apply any change, a dot appears in the path bar of the modified side. This dot signals that the in-memory content differs from the saved file on disk. The dot clears when you save.
If you close a tab with unsaved changes, Diffract prompts you to save or discard before closing.
Saving¶
Press Ctrl+S to save the active side. Diffract writes the in-memory content to the file path shown in that side's path bar. The unsaved-changes dot clears after a successful save.
Undo and redo¶
All edits - including applied blocks and line applies - are tracked in a 200-step undo history.
- Ctrl+Z - undo the last change
- Ctrl+Shift+Z or Ctrl+Y - redo
Note
Typing in the panel is debounced - rapid keystrokes are grouped into a single undo step so that one undo reverts the whole word or phrase you typed, not one character at a time.