13. Plugins

Plugins are extra-features for WinMerge. They are not included in the basic version because they interest few users, or because they do not fit in WinMerge architecture.

Each plugin :

"Plugins" is a generic name for extra-feature dll or scriptlets. Plugins features are spread over three categories : file editor complement, unpacker, prediffer.

13.1. Three categories of plugins

13.1.1. Editor complement

Operate custom operations on the currently selected text from the active pane.

Example plugin : turn the selection to uppercase or lowercase.

13.1.2. Unpack (transform) a file to a text format

The original file is not changed. A temporary transformed file is created and loaded in WinMerge.

Sometimes the transformed file can be packed back. Then you may merge and save the transformed file. Packing is done automatically in this case. See the plugin details to know if it supports packing back.

Example plugin : decompress Delphi4 binary files (extension .dfm).

Note

When you compare directories, WinMerge doesn't need to display the files, but the diffing process can give a different result when you compare compressed and not compressed files (for example, uncompressed files may be identical, but the compressed files may differ if they include the date of creation). WinMerge applies the unpacker in all situations, and you are sure to have the same result when you compare directories, or when you merge two versions of a file.

13.1.3. Prediff - Process files to hide some differences

The files are loaded normally. No change is applied to the displayed file. Copies are made and processed by the plugin, and the diffing algorithm operates on these copies.

Example plugin : ignore the differences inside given columns, while displaying the characters in these columns.

13.2. Select and apply a plugin

13.2.1. "Suggested plugin" and "Automatic mode"

Each plugin specifies a list of file extensions (see plugins details for more info). When the file extension, either from the left or from the right file, matches the plugin list, the plugin is called "a suggested plugin".

When "Automatic mode" is on, WinMerge searches for a suggested plugin and applies it if it is avaialble. When two suggested plugins are available for a file, WinMerge applies the first one only (alphabetical order).

Note

"Automatic Unpacking" and "Auto prediffer" are two separate options. There is no option for editor complements.

13.2.3. Editor complement in editor view

Access list with main menu, Edit->Scripts->...

13.2.4. Unpacker in directory view

Check Plugins->Automatic Unpacking in the main menu. Update the results (F5). Each file is loaded again with its suggested unpacker and compared.

13.2.5. Unpacker in editor view

Three possibilities

Open dialog : select the two files first. Then press the button "Select" right from the filed "Unpacker". WinMerge displays the standard dialog for unpacker selection. Use the top combobox to select the plugin. Two generic choices are available also : "None" and "Automatic".

From the directory view when Plugins->Automatic Unpacking is checked : just double click to open the file. The suggested plugin used during the directory comparison is used to load the file in the editor.

From the directory view, always : select one file, then main menu Plugins->Edit with Unpacker. WinMerge displays the dialog for unpacker selection. Select an unpacker and press "OK", WinMerge opens the editor view and applies this unpacker to load the file. This plugin is forgotten when you close the editor view.

13.2.6. Prediffer in directory view

When the files are selected, right-click to open the context menu. Follow Plugin Settings->Prediffer Settings and select "Auto prediffer" or "No prediffer". Refresh the view (F5) to update the results.

Note

"Auto prediffer" is a per-file option. Some files in the same directory can be in mode "No prediffer" and some in mode "Auto prediffer". When you change directory during a non-recursive compare, the mode is always reset to "No prediffer".

13.2.7. Prediffer in editor view

Two possibilities

From the directory view when "Auto prediffer" is checked for a file : just double click to open the file. The plugin used during the directory comparison is used in the editor before the diff algorithm.

During an editor session, access prediffer lists with menu Plugins->Prediffer->... The active prediffer is checked. Suggested plugins are indicated first above the not-suggested ones. The files are compared again after the selection, you don't need to rescan.

13.3. Plugin details

A file Plugins.txt is created during the setup process. It documents each installed plugin with the name and a quick description. If you don't use installer Plugins.txt is found from MergePlugins subfolder.

Developers may find information and code of examples in the source package, under the directory "Plugins".

13.4. Windows Script Host

Some editor complements need this optional component from Microsoft.

If the list of editor complements does not present all editor plugins, this component is probably missing.

You can check easily. WinMerge informs you with a comment at the bottom of the list.

You may install WSH on any version of Windows (need IE 4.0). Download it from MSDN Library.