hotkeys: Add hotkey `G` an alias for End.

Fixes #4195.
This commit is contained in:
Joshua Pan 2017-03-23 07:11:00 +00:00 committed by Tim Abbott
parent 5d030e9173
commit f40b43a491
4 changed files with 6 additions and 3 deletions

View File

@ -140,7 +140,7 @@ function stubbing(func_name_to_stub, test_function) {
// Unmapped keys should immediately return false, without
// calling any functions outside of hotkey.js.
assert_unmapped('abdefhlmnoptuxyz');
assert_unmapped('BEFGHILMNOQTUVWXYZ');
assert_unmapped('BEFHILMNOQTUVWXYZ');
// We have to skip some checks due to the way the code is
// currently organized for mapped keys.
@ -209,6 +209,7 @@ function stubbing(func_name_to_stub, test_function) {
assert_mapping('v', 'lightbox.show_from_selected_message');
assert_mapping('i', 'popovers.open_message_menu');
assert_mapping(':', 'popovers.toggle_reactions_popover', true);
assert_mapping('G', 'navigate.to_end');
}());
(function test_motion_keys() {

View File

@ -100,6 +100,7 @@ var keypress_mappings = {
65: {name: 'stream_cycle_backward', message_view_only: true}, // 'A'
67: {name: 'compose_private_message', message_view_only: true}, // 'C'
68: {name: 'stream_cycle_forward', message_view_only: true}, // 'D'
71: {name: 'G_end', message_view_only: true}, // 'G'
74: {name: 'vim_page_down', message_view_only: true}, // 'J'
75: {name: 'vim_page_up', message_view_only: true}, // 'K'
80: {name: 'narrow_private', message_view_only: true}, // 'P'
@ -594,6 +595,7 @@ exports.process_hotkey = function (e, hotkey) {
navigate.to_home();
return true;
case 'end':
case 'G_end':
navigate.to_end();
return true;
case 'page_up':

View File

@ -34,7 +34,7 @@ Zulip keyboard shortcuts are divided into four categories:
* **Scroll down**: `J`, `Spacebar`, or `PgDn` (`Fn` + `↓` on Mac) -
This shortcut allows the user to scroll down through the messages in
their view.
* **Last message**: `End` (`Fn`+`⇾` on Mac) - This shortcut
* **Last message**: `End` (`Fn`+`⇾` on Mac) or `G` - This shortcut
allows the user to scroll to the most recent message in their view.
* **First message in view**: `Home` (`Fn`+`⇽` on Mac) - This shortcut
allows the user to scroll to the most recent message in their view.

View File

@ -37,7 +37,7 @@
<td class="definition">{% trans %}Scroll down{% endtrans %}</td>
</tr>
<tr>
<td class="hotkey">End</td>
<td class="hotkey">End, G</td>
<td class="definition">{% trans %}Last message{% endtrans %}</td>
</tr>
</table>