Diff/Merge Tool

Index of All Documentation » Wing Pro Reference Manual »

Wing Pro provides single and multi-file difference and merge capabilities that can be used to compare files or directories and to manage differences to a version control repository (see Integrated Version Control).

To initiate a session, use the Diff/Merge toolbar item (click to display a menu of options) or use the Difference and Merge menu item in the Source menu. You will be prompted for any file or directory names in the status area at the bottom of the IDE window. Additional sessions can be started concurrently but only one session is current at a given time. The same menus can be used to switch among multiple concurrent sessions, when there are two or more.

Once a session is started, the selected files will be displayed side by side, one annotated with A: and the other annotated with B:. Use the newly revealed toolbar items to move to the next or previous difference pair, to merge differences from one file into the other, or to terminate the session. Navigation and merging is also possible with the key bindings listed in the diff/merge menu.

In addition, a summary listing all changes is available from the diff/merge icon displayed at the top right of editors in the active session. This includes line number, change summary, and Python scope name when applicable. Selecting a change from this menu will jump to it.

The following types of difference/merge sessions are available:

  • Compare Files -- Compare two selected files.
  • Compare Directories -- Compare two selected directories. The Diff/Merge tool, which will be shown while the multi-file session is active, will display a list of files and estimated degree of difference in each file pair. Clicking on the list will display the first difference in the selected file pair. The selection on the list will also update as you move through the difference list.
  • Compare Visible Files -- Compare the two visible files. This is only available when two editor splits are shown and two different files are open in them.
  • Compare Buffer with Disk -- Compare the current file and its contents on disk. This is only available when the current file has unsaved edits.
  • Compare Recent -- This provides a sub-menu for quick access to recently performed comparisons.
  • Compare to Repository -- When a file is in checked into one of the version control systems that Wing Pro supports, this item can be used to compare the working copy of the file with the corresponding revision in version control.

Diff/Merge Options

The Difference and Merge menu also contains two items that control the action of the diff/merge sessions:

  • Lock Scrolling -- When this is checked, Wing keeps the scrolling position of the two files in the diff/merge session synchronized.
  • Ignore Whitespace -- When this is checked, Wing will ignore changes that consist solely of white space (space, tab, line feed, or carriage return characters).

It is also possible to select between side by side or top/bottom orientation of the two files shown during a difference and merge session using the Orientation preference.

The color used in the highlights for differences can be configured with the Diff/Merge Color preference.