mirror of
https://github.com/baairon/torlink.git
synced 2026-07-08 18:28:22 +02:00
feat: add hjkl navigation alongside the arrow keys (#29)
Layer vim-style h/j/k/l onto the existing arrow navigation across the sidebar, results, downloads, and seeding. Arrows unchanged.
This commit is contained in:
@@ -177,13 +177,13 @@ export function Results() {
|
||||
setMode("search");
|
||||
return;
|
||||
}
|
||||
if (key.upArrow) {
|
||||
if (key.upArrow || input === "k") {
|
||||
if (results.length > 0 && clamped > 0) setCursor(clamped - 1);
|
||||
else setMode("search");
|
||||
return;
|
||||
}
|
||||
if (results.length === 0) return;
|
||||
if (key.downArrow) setCursor(wrapStep(clamped, 1, results.length));
|
||||
if (key.downArrow || input === "j") setCursor(wrapStep(clamped, 1, results.length));
|
||||
else if (key.pageUp) setCursor(Math.max(0, clamped - pageJump));
|
||||
else if (key.pageDown) setCursor(Math.min(results.length - 1, clamped + pageJump));
|
||||
else if (key.return) {
|
||||
|
||||
Reference in New Issue
Block a user