Enable expanding skipped lines even if 'Syntax Coloring' is off
On SideBySide diff UI if 'Syntax Coloring' is disabled attempting to expand 'skipped common xx lines' will result in only one line displaying on the left side. Enabling 'Syntax Coloring' makes the expand work correctly on both sides. This issue has existed since v2.3, as the server was not including enough file content to support expanding the skipped regions. Change-Id: I6f33b21415746a54c0cdc507246c139b49cd045d
This commit is contained in:
@@ -292,17 +292,17 @@ public abstract class AbstractPatchContentTable extends NavigationTable<Object>
|
||||
protected SparseHtmlFile getSparseHtmlFileB(PatchScript s) {
|
||||
AccountDiffPreference dp = new AccountDiffPreference(s.getDiffPrefs());
|
||||
|
||||
SparseFileContent b = s.getB();
|
||||
PrettyFormatter f = ClientSideFormatter.FACTORY.get();
|
||||
f.setDiffPrefs(dp);
|
||||
f.setFileName(s.getB().getPath());
|
||||
f.setFileName(b.getPath());
|
||||
f.setEditFilter(PrettyFormatter.B);
|
||||
f.setEditList(s.getEdits());
|
||||
|
||||
if (dp.isSyntaxHighlighting() && s.getA().isWholeFile() && !s.getB().isWholeFile()) {
|
||||
f.format(s.getB().apply(s.getA(), s.getEdits()));
|
||||
} else {
|
||||
f.format(s.getB());
|
||||
if (s.getA().isWholeFile() && !b.isWholeFile()) {
|
||||
b = b.apply(s.getA(), s.getEdits());
|
||||
}
|
||||
f.format(b);
|
||||
return f;
|
||||
}
|
||||
|
||||
|
@@ -198,10 +198,10 @@ class PatchScriptBuilder {
|
||||
context = diffPrefs.getContext();
|
||||
hugeFile = true;
|
||||
|
||||
} else if (diffPrefs.isSyntaxHighlighting()) {
|
||||
// In order to syntax highlight the file properly we need to
|
||||
// give the client the complete file contents. So force our
|
||||
// context temporarily to the complete file size.
|
||||
} else {
|
||||
// In order to expand the skipped common lines or syntax highlight the
|
||||
// file properly we need to give the client the complete file contents.
|
||||
// So force our context temporarily to the complete file size.
|
||||
//
|
||||
context = MAX_CONTEXT;
|
||||
}
|
||||
|
Reference in New Issue
Block a user