Commit 3c071011 authored by Thomas Randolph's avatar Thomas Randolph

Add keyboard shortcuts for commit navigation

parent ee921003
......@@ -224,6 +224,7 @@ export default {
methods: {
...mapActions(['startTaskList']),
...mapActions('diffs', [
'moveToNeighboringCommit',
'setBaseConfig',
'fetchDiffFiles',
'fetchDiffFilesMeta',
......@@ -344,9 +345,16 @@ export default {
break;
}
});
if (this.commit) {
Mousetrap.bind('c', () => this.moveToNeighboringCommit({ direction: 'next' }));
Mousetrap.bind('x', () => this.moveToNeighboringCommit({ direction: 'previous' }));
}
},
removeEventListeners() {
Mousetrap.unbind(['[', 'k', ']', 'j']);
Mousetrap.unbind('c');
Mousetrap.unbind('x');
},
jumpToFile(step) {
const targetIndex = this.currentDiffIndex + step;
......
......@@ -313,6 +313,18 @@
%td.shortcut
%kbd p
%td= _('Previous unresolved discussion')
%tbody
%tr
%th
%th= _('Merge Request Commits')
%tr
%td.shortcut
%kbd c
%td= _('Next commit')
%tr
%td.shortcut
%kbd x
%td= _('Previous commit')
%tbody
%tr
%th
......
......@@ -13028,6 +13028,9 @@ msgstr ""
msgid "Merge Request Approvals"
msgstr ""
msgid "Merge Request Commits"
msgstr ""
msgid "Merge Requests"
msgstr ""
......@@ -13886,6 +13889,9 @@ msgstr ""
msgid "Next"
msgstr ""
msgid "Next commit"
msgstr ""
msgid "Next file in diff"
msgstr ""
......@@ -15592,6 +15598,9 @@ msgstr ""
msgid "Previous Artifacts"
msgstr ""
msgid "Previous commit"
msgstr ""
msgid "Previous file in diff"
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment