impr(commandline): add vim keybinds for navigating up and down

This commit is contained in:
Miodec 2024-07-01 16:10:10 +02:00
parent 8e83dea30f
commit b8fce15490

View file

@ -603,11 +603,11 @@ const modal = new AnimatedModal({
input.addEventListener("keydown", async (e) => {
mouseMode = false;
if (e.key === "ArrowUp") {
if (e.key === "ArrowUp" || (e.key.toLowerCase() === "k" && e.ctrlKey)) {
e.preventDefault();
await decrementActiveIndex();
}
if (e.key === "ArrowDown") {
if (e.key === "ArrowDown" || (e.key.toLowerCase() === "j" && e.ctrlKey)) {
e.preventDefault();
await incrementActiveIndex();
}