Viewing Differences

Managing Screen Real-Estate

Kompare displays the source and destination file under using equal percentage of the main interface view work area. This view area provides some features that help optimize use of screen real-estate while viewing differences, including:

Dual Scrollbars

The most obvious feature is that scrollbars are provided both on the right and bottom edges of the view area. Using the scrollbars it is possible to move rapidly through the comparison.

Share Grip Handle

The vertical space between the source and destination view not only makes it possible to clearly see the start and end of lines in each of the panes, but is also a grip handle that allows adjustment of percentage occupied between the source and destinate views that comprise the view pane. To change pane size for one of the views, hover the mouse pointer over the grip handle then hold down the mouse button and drag left or right. Naturally, increasing the area of one pane will decrease the area available to the opposite pane within the view panel area.

A second horizontal handle is available between the navigation panel and the source and destination view.

Docking

The navigation panel can be undocked from the main interface by clicking the icon located top right of the panel. This opens it in a window of its own, allowing you to move it across the screen. You can even hide the navigation panel by clicking the icon. To display a hidden navigation bar again, click with the right mouse button into the menubar and select Navigation from the context menu.

Statusbar Toggle

The status bar of the view panel can be toggled on and off by selecting SettingsShow Statusbar.

Switching Source and Destination Views

Sometimes it can be useful to consider what the file to which differences where to be applied as the source. For example, when comparing two modified versions of a file and discovering that the one file has many more modifications that the other. The file with more changed would be better as the source, since then fewer differences would need to be applied.

In this case select FileSwap Source with Destination. This will switch the files displayed in all Kompare panels.

Displaying Difference Statistics

For a quick overview of the differences, select FileShow Statistics. This will display the Diff Statistics dialog. The following information is provided:

Old file:

The file name of what is usually the source file or file that is unmodified.

New file:

The file name of what is usually the destination file or file that is modified and to which differences will be applied.

Format:

The diff format used to display the difference (see the section called “Format”).

Number of hunks:

The number of hunks found in the difference.

A hunk is a chunk of lines that have been marked as different between source and destination and may include context lines depending on the diff format Lines of Context value (see the section called “Format”).

Number of differences

The actual number of differences found, not hunks. A hunk can contain one or more differences when the line change range and the context lines of any two or more changes overlap.

Navigating the Difference View

Kompare enables rapid navigation of differences on a file level and of multiple difference files when comparing folder trees.

Selecting a Difference

A difference can be selected using by:

  • clicking a line in the Source and Destination Line Changes pane (top right of the main window).

  • clicking the highlighted difference in the View pane.

  • traversing the listed differences in a comparison (see the section called “Traversing Differences”).

When a difference is selected it is considered to be in focus and is displayed in a brighter color that non-selected differences.

Traversing Differences

When a comparison finds many differences one of the best ways to approach reviewing them is to traverse the differences in a logical order, usually from top to bottom.

By default Kompare selects the first difference found in a comparison. By selecting DifferenceNext Difference (Ctrl+Down) the difference following the current selection is brought into focus. To select the difference before the current difference select DifferencePrevious Difference (Ctrl+Up).

In this way it is possible to traverse differences in an orderly manner, applying and unapply differences upon review.

Switching Between Files

When a comparison is performed on folder level, many files may be found with differences. A complete list of the files compared with difference found is provided in the Source and Destination Folders, and Source and Destination Files panes. However, Kompare displays differences between source and destination one comparison at time.

To switch between documents in this scenario the following options are available:

  • Select the Source and Destination Folders pane to display file differences found in the Source and Destination Files pane, then select a file.

  • Select DifferencePrevious File (Ctrl+PgUp) or DifferenceNext File (Ctrl+PgDown) to display the previous or next difference file found in the Source and Destination Files pane.