The visual comparison, available either from the VCS menus or from the Tools menu, provide a way to display graphically differences between two or three files, or two different versions of the same file.
The 2-file comparison tool is based on the standard text command diff, available on all Unix systems. Under Windows, a default implementation is provided with GPS, called gnudiff.exe. You may want to provide an alternate implementation by e.g. installing a set of Unix tools such as cygwin (http://www.cygwin.com).
The 3-file comparison tool is based on the text command diff3, available on all Unix systems. Under Windows, this tool is not shipped with GPS. It is available as part of cygwin, for example.
When querying a visual comparison in GPS, in Side_By_Side mode, the user area will show, side by side, editors for the files involved in the comparison. The reference file is placed by default on the left side. When in Unified mode, GPS will not open a new editor, but will show all the changes directly in the original editor. Note that Unified mode is relevant only when comparing two files: when comparing three files, the Side_By_Side mode is used.
Color highlighting will be added to the file editors:
These colors can be configured, see The Preferences Dialog.
As with all highlighted lines in GPS, the visual differences highlights are visible in the Speed Column at the left of the editors.
Blank lines are also added in the editors, in places that correspond to existing lines in the other editors. The vertical and horizontal scrolling are synchronized between all editors involved in a visual comparison.
When a visual comparison is created, the Locations View is populated with the entries for each chunk of differences, and can be used to navigate between those.
Closing one of the editors involved in a visual comparison removes the highlighting, blank lines, and scrolling in the other editors.
Editors involved in a visual comparison have a contextual menu
Visual diff
that contains the following entries:
Recompute
Hide
Close editors
Use this editor as reference