drafts: Allow vim up and down key to scroll between drafts.

Added a fix to bind vim_up(k) and vim_down(j) keys
with the draft section, allowing users to scroll
between the drafts using 'k' (scroll up) and
'j'(scroll down) keys.

Fixes #18397
This commit is contained in:
aryanshridhar
2021-05-08 18:52:44 +05:30
committed by Tim Abbott
parent c25155a143
commit 9f15de41f3
2 changed files with 4 additions and 2 deletions

View File

@@ -471,13 +471,13 @@ export function drafts_handle_events(e, event_key) {
// This detects up arrow key presses when the draft overlay
// is open and scrolls through the drafts.
if (event_key === "up_arrow") {
if (event_key === "up_arrow" || event_key === "vim_up") {
drafts_scroll(row_before_focus());
}
// This detects down arrow key presses when the draft overlay
// is open and scrolls through the drafts.
if (event_key === "down_arrow") {
if (event_key === "down_arrow" || event_key === "vim_down") {
drafts_scroll(row_after_focus());
}