The compare command can be used to compare the current document to a specified file. Lines that exist in the specified file but not in the current document are highlighted with the styleAttributes.deletedLines style attributes. Lines that exist in the current document but not in the specified file are highlighted with the styleAttributes.addedLines style attributes.
compare { clear | next | previous | refresh | prompt [ "fileName" ] | [ "fileName" ] }
clear | Use the parameter clear to indicate that you want to remove the compare information from a previous compare. |
next | Use the parameter next to indicate that you want to move forward to the next mismatch. This will not wrap around to the top of the file. |
previous | Use the parameter previous to indicate that you want to move backward to the previous mismatch. This will not wrap around to the bottom of the file. |
refresh | Use the parameter refresh to refresh the comparison against the previously specified file, using the latest changes in the current view. |
prompt [ "fileName" ] | Use the parameter prompt to indicate that the compare file dialog should be displayed to allow the user to select a file. If the optional parameter fileName is specified, the compare file dialog will be initialized with the specified file name. |
[ "fileName" ] | Use the parameter fileName to indicate the file that should be used. If no filename is specified, the document will be compared with the saved version of the file. |
The status parameter will be set to one of the following:
null Indicates that the compare command successfully located the specified file. file.notFound Indicates that the compare command could not locate the specified file. file.errorReading Indicates that the compare command encountered an error while reading the file.
Lines which exist in the current document but not in the compare document are highlighted and continue to be part of the document. Lines that do not exist in the current document but exist in the compare document are inserted as show elements in the current document view. They are protected and cannot be edited. Since they are show elements, they will not be saved with the document. The comparison takes into account the settings of the compare.parameter parameters. After changing these settings another compare or compare refresh command must be issued before the view will reflect the changes.
compare prompt compare "test.java" compare clear compare next compare previous compare refresh
compare.ignoreCase parameter
compare.ignoreLeadingBlanks parameter
compare.ignoreTrailingBlanks parameter
compare.ignoreAllBlanks parameter
show parameter
styleAttributes parameter
compare action
compareClear action
compareNext action
comparePrevious action
compareRefresh action
Default editor commands