File Compare

The File Compare window shows differences between two files. This is a fancy version of the diff tool.

The window is divided into three parts: The left and right files, plus a difference list on the left side. By default, the File Compare window is grouped with the Directory Compare window in a tabbed panel.

inset_4_2.jpg

 

Toolbar

1.Compare Directory - switches to the Directory Compare window.

2.Refresh - Re-examines files and refreshes the window.

3.Show line numbers

4.Lock the window

5.Previous Difference (Ctrl+Up) / Next Difference (Ctrl+Down) - selects the previous or next differ­ence in the files.

6.Copy selected lines left (Alt+Left) or right (Alt+Right) - the selected block of lines will be copied to the other file. This can be undone. This type of edit is disabled by default for safety, but you will be prompted to enable it.

7.Undo (Ctrl+Z) and Redo (Ctrl+Shift+Z) the lines that were copied.

8.Open new files to compare (Ctrl+O)

9.File Compare Window Options (Ctrl+Q) - opens the options window. See: File Compare Window Options.

Right-Click Menu

To Compare Two Files

 

To compare two files, click the toolbar button (8) to open two new files to compare, or select Tools > Com­pare Files. See: Compare Files.

You can also compare the current file with an older backup version by selecting Tools > Compare with Backup File.  

Working in the File Compare Window

The left and right files are displayed side by side and aligned so that similar lines will line up horizontally. If you are using syntax formatting that uses multiple font sizes, sometimes the alignment can be off a little. You can right-click and select "Mono Font View" to switch to a monospaced font, which will make it easier to align the two files.

The left and right files scroll vertically together. However, you can scroll one file independently by holding down Ctrl while clicking up or down in the vertical scrollbar.

You an control zooming by holding down Ctrl and using the mouse wheel. Alternatively, you can open the File Compare Window Options and specify the zoom factor.

To jump to the definition of a symbol in the File Compare window, hold down Ctrl and click on the symbol name. The File Compare Window will minimize and a source file window will open at the symbol definition.

If the file type has the option enabled for "Highlight references to selected symbols", then you can click on symbol identifiers in the File Compare windows and Source Insight will automatically highlight references to that symbol. See: File Type Options.

Difference List

The Difference List appears on the left side. It shows a list of difference blocks in the file, and shows what symbols the differences are contained within. The symbols are the ones defined in the left hand file. You can show or hide the difference list by right-clicking on it and selecting Difference List.

Selecting Difference Blocks

You can click on a highlighted difference block to select it. Once a block is selected, you can copy it to the clipboard, or copy it to the left or right file.

To move to the next difference, use the Next Difference command (Ctrl+Down). To move to the previous dif­ference, use the Previous Difference command (Ctrl+Up).