Java Reference
In-Depth Information
Figure 8.17
IDEA's internal diff tool is an excellent utility for reviewing file differences.
Navigating through the changes
Like the editor, the diff viewer features change marks in the right and left borders
of the view that allow you to see all the changes in the file at a glance. You can
click a change mark to move your cursor to that change, or you can scroll down
through the file to review the changes. Scrolling between the two views is linked,
making it easy to examine changes across the entire file; but for larger files, scroll-
ing through all the changes may not be the fastest way of navigating. You can use
the
Next Change
and
Previous Change
buttons on the toolbar (
F7
and
Shift+F7
) to jump from one change to the next.
The diff viewer also features its own version of the
Find
tool, which works just
like the
Search | Find
command. Click the
Find
icon (or press
Ctrl+F5
), and
enter your search terms. The
Find
command will search whichever panel is cur-
rently selected.
Copying over code from a previous version
To revert an entire file to an older version, you can use the
History
view to over-
write the current file with the contents of the older one, as discussed earlier. If,
instead, you want to get a portion of the older version—for example, a single
method—you can do so through the diff viewer. If you right-click over a change