使用 compare 命令来将当前文档与指定的文件作比较。将使用 styleAttributes.deletedLines 样式属性来突出显示存在于指定文件中但不存在于当前文档中的行。将使用 styleAttributes.addedLines 样式属性来突出显示存在于当前文档中但不存在于指定文件中的行。
compare { clear | next | previous | refresh | [ ignoredStyles styleChars ] { prompt [ "fileName" ] | [ [ fileOptions ] "fileName" ] } }
clear | 使用 clear 参数来除去来自上一个比较会话的比较信息。 |
next | 使用 next 参数来向前移至下一个不匹配处。这不会回绕至文档顶部。 |
previous | 使用 previous 参数来向后移至上一个不匹配处。这不会回绕至文档底部。 |
refresh | 使用 refresh 参数来使用当前视图中的最新更改刷新对先前指定的文件所作的比较。 |
ignoredStyles styleChars | 使用 ignoredStyles 参数来指示在进行比较时应该忽略与 styleChars 参数指定的样式字符相对应的文本。还将忽略空格。样式字符由文档解析器设置。 |
prompt [ "fileName" ] | 使用 prompt 参数来指示应该显示比较文件对话框以允许用户选择文件。如果指定了可选参数 fileName,则将使用指定的文件名来初始化比较文件对话框。 |
fileOptions | 比较文件的可选设置,具有以下格式:
[ sequenceNumbers numColumn numWidth textColumn textWidth ] [ encoding charEncoding ]使用 sequenceNumbers 参数来指定文件的序号设置是 numColumn numWidth textColumn textWidth。如果未指定此参数,则假定比较文件与当前文档具有相同的序号设置。有关指定序号的其他信息,参见 sequenceNumbers 编辑器参数。 使用 encoding 参数来指定文件的字符编码是 charEncoding。如果指定空字符串(""),则编辑器尝试自行检测文件编码,如果不成功的话,则缺省为本机编码。如果未指定字符编码,则假定比较文件采用本机(平台缺省)字符编码。 |
"fileName" | 使用 fileName 参数来指示应该使用的文件。如果未指定 filename,则将把文档与它的底层文件的保存版本作比较。 |
status 参数将被设置为下列其中一项:
null compare 命令成功地找到指定的文件。 file.notFound compare 命令无法找到指定的文件。 file.errorReading compare 命令在读取文件时遇到错误。
存在于当前文档但不在比较文档中的行将突出显示,且继续作为文档的一部分。不存在于当前文档中但存在于比较文档中的行将作为显示元素插入到当前视图中。它们受保护,不能编辑。因为它们是显示元素,所以不会将它们与文档保存在一起。
比较操作将考虑 compare. 参数的设置。在更改这些设置中的任何一些设置之后,必须发出另一个 compare 或 compare refresh 命令才能使视图反映更改。
compare prompt compare "test.java" compare encoding Cp850 "test.java" compare ignoredStyles "c" prompt "test.java" compare clear compare next compare previous compare refresh
compare.columns 参数
compare.endColumn 参数
compare.ignoreAllBlanks 参数
compare.ignoreCase 参数
compare.ignoreComments 参数
compare.ignoreLeadingBlanks 参数
compare.ignoreSequenceNumbers 参数
compare.ignoreTrailingBlanks 参数
compare.startColumn 参数
sequenceNumbers 参数
show 参数
status 参数
style 参数
styleAttributes 参数
compare 操作
compareAllBlanks 操作
compareCase 操作
compareClear 操作
compareComments 操作
compareLeadingBlanks 操作
compareNext 操作
comparePrevious 操作
compareRefresh 操作
compareSequenceNumbers 操作
compareTrailingBlanks 操作
Copyright IBM Corporation 1992, 2006. All Rights Reserved.