Make 'c', 'r' in a patch view open a new comment editor
Like enter, these open a new comment editor for the current line. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
@@ -107,6 +107,17 @@ public abstract class AbstractPatchContentTable extends FancyFlexTable<Object> {
|
|||||||
case KeyboardListener.KEY_UP:
|
case KeyboardListener.KEY_UP:
|
||||||
case KeyboardListener.KEY_DOWN:
|
case KeyboardListener.KEY_DOWN:
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
case 'c':
|
||||||
|
case 'r':
|
||||||
|
for (int row = getCurrentRow(); 0 <= row; row--) {
|
||||||
|
final Object item = getRowItem(row);
|
||||||
|
if (!(item instanceof CommentList) && item != null) {
|
||||||
|
onOpenItem(item);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return super.onKeyPress(keyCode, modifiers);
|
return super.onKeyPress(keyCode, modifiers);
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public abstract class FancyFlexTable<RowItem> extends Composite implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onOpen() {
|
protected void onOpen() {
|
||||||
if (0 <= currentRow && currentRow < table.getRowCount()) {
|
if (0 <= currentRow && currentRow < table.getRowCount()) {
|
||||||
final RowItem item = getRowItem(currentRow);
|
final RowItem item = getRowItem(currentRow);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user