From f1d8d0edea19b119dc4e3e4732c79e3dd2102b4d Mon Sep 17 00:00:00 2001 From: Scott Worley Date: Sat, 29 Jan 2022 12:46:36 -0800 Subject: [PATCH 1/1] vi-style count-prefix for task movement --- vopamoi.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vopamoi.ts b/vopamoi.ts index 3ccc562..d3b2c05 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -492,6 +492,7 @@ var inputState = InputState.Root; var inputCount: number | null = null; function handleKey(event: any) { + if (["Alt", "Control", "Meta", "Shift"].includes(event.key)) return; if (event.target.tagName === "INPUT") { if (event.target.id === "taskName") { if (event.key == "Enter") return browserUI.addTask(event); @@ -511,8 +512,8 @@ function handleKey(event: any) { try { if (event.key == "j") return browserUI.moveCursor(inputCount ?? 1); if (event.key == "k") return browserUI.moveCursor(-(inputCount ?? 1)); - if (event.key == "J") return browserUI.moveTask(1); - if (event.key == "K") return browserUI.moveTask(-1); + if (event.key == "J") return browserUI.moveTask(inputCount ?? 1); + if (event.key == "K") return browserUI.moveTask(-(inputCount ?? 1)); if (event.key == "T") return browserUI.makeTopPriority(); if (event.key == "n") return browserUI.focusTaskNameInput(event); if (event.key == "c") return browserUI.setState("cancelled"); -- 2.44.1