commit | ce4a59b0a8e02940e8ff5e9b3fb97f21509a4e70 | [log] [tgz] |
---|---|---|
author | Shawn O. Pearce <sop@google.com> | Thu Mar 04 17:12:29 2010 -0800 |
committer | Shawn O. Pearce <sop@google.com> | Thu Mar 04 17:12:29 2010 -0800 |
tree | fc688ea3892b9d6aaaddd6c4ed84f1adef268a47 | |
parent | 0a7cb714783393e852ee3ec7b9065070e2bf575b [diff] |
Fix toggling syntax highlighting on partial file We cannot reuse the cached script data if we don't have the full file and the user has asked us for syntax highlighting. Instead discard and get the full script. Change-Id: I358ee938b12253ea9a14e9144844574778eb4978 Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchScreen.java b/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchScreen.java index 84bb6cf..9c5fbce 100644 --- a/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchScreen.java +++ b/gerrit-gwtui/src/main/java/com/google/gerrit/client/patches/PatchScreen.java
@@ -247,6 +247,13 @@ // We don't have sufficient context. return false; } + + if (s.getPrettySettings().isSyntaxHighlighting() + && !last.getA().isWholeFile()) { + // We need the whole file to syntax highlight accurately. + return false; + } + return true; }