X-Git-Url: http://git.scottworley.com/vopamoi/blobdiff_plain/109d4bc26db6a0f5a6b6afd72446827d25fc334e..997d8d55032aba314fa674c19ce25463af30c972:/vopamoi.ts diff --git a/vopamoi.ts b/vopamoi.ts index 302307f..5f759d0 100644 --- a/vopamoi.ts +++ b/vopamoi.ts @@ -297,9 +297,6 @@ function BrowserUI() { this.firstVisibleTask()?.focus(); } input.value = ""; - if (currentTagView) { - ui.addTag(task.getAttribute("data-created")!, currentTagView); - } if (event.getModifierState("Control")) { this.makeBottomPriority(task); } @@ -441,6 +438,18 @@ function BrowserUI() { task instanceof HTMLElement && task.focus(); }, + moveCursorLeft: function () { + const active = this.currentTask(); + if (!active) return false; + if (active.parentElement!.classList.contains("task")) { + active.parentElement!.focus(); + } + }, + + moveCursorRight: function () { + (this.currentTask()?.getElementsByClassName("task")[0] as HTMLElement)?.focus(); + }, + moveCursorVertically: function (offset: number): boolean { const active = this.currentTask(); if (!active) return false; @@ -643,6 +652,8 @@ function handleKey(event: any) { if (event.key == "e") return window.scrollBy(0, (inputCount ?? 1) * scrollIncrement); if (event.key == "y") return window.scrollBy(0, (inputCount ?? 1) * -scrollIncrement); } else { + if (event.key == "h") return browserUI.moveCursorLeft(); + if (event.key == "l") return browserUI.moveCursorRight(); if (event.key == "j") return browserUI.moveCursorVertically(inputCount ?? 1); if (event.key == "k") return browserUI.moveCursorVertically(-(inputCount ?? 1)); if (event.key == "J") return browserUI.moveTask(inputCount ?? 1);