Fix bad help display of keyboard shortcuts When merging "idential" key commands onto a single help line, actually merge them onto the row that is common, rather than the first row of the section. This prevents the "u" binding in Gerrit Code Review from sometimes showing up on the wrong help line, suggesting it does a different action. Change-Id: Ica4ff0f1e2165e92ccfbb9b238eeaf7da513d7c2
diff --git a/src/main/java/com/google/gwtexpui/globalkey/client/KeyHelpPopup.java b/src/main/java/com/google/gwtexpui/globalkey/client/KeyHelpPopup.java index 26fefbe..7bd0233 100644 --- a/src/main/java/com/google/gwtexpui/globalkey/client/KeyHelpPopup.java +++ b/src/main/java/com/google/gwtexpui/globalkey/client/KeyHelpPopup.java
@@ -168,8 +168,9 @@ continue; } - for (int prior = 0, r = initialRow; prior < i; prior++) { + for (int prior = 0; prior < i; prior++) { if (KeyCommand.same(keys.get(prior), k)) { + final int r = initialRow + prior; final SafeHtmlBuilder b = new SafeHtmlBuilder(); b.append(SafeHtml.get(lists, r, col + 0)); b.append(" ");