A sub compare is a textual compare session that is "nested" within the model compare session. When doing sub compare, a text-based compare tool is launched in order to show the differences that are located in pieces of text, such as code snippets. For C++ code snippets, sub compare by default uses the compare tool that is provided by CDT. Hence you can compare changed C++ code snippets in the same way as you compare two changed C++ files.
Sub compare provides many benefits, such as:
Sub compare starts automatically when you select a change that is related to code snippets. The textual compare tool that sub compare uses replaces the two contributor model tabs. It may look like this:
To stop the sub compare session you can press the button Show Visualization of Structural Changes ( ). If you later want to go back to sub compare you can press the button Show Text Sub Merge Pane (
). This command is also available in the context menu of the Text tab.
In addition to code snippets it is possible to launch sub compare on changes related to documentation comments. This is especially useful if the documentation comment contains rich text. To launch sub compare on a documentation comment, choose Compare As Rich Text in the Sub Compare button menu:
The rich text sub compare tool understands the contents of rich text comments better than the plain text compare tool, and can highlight the changes in the comments in a better way: