Skip to content

Commit

Permalink
fix: revert j and k for scroll if no blogs exist
Browse files Browse the repository at this point in the history
  • Loading branch information
barraIhsan committed Oct 18, 2024
1 parent c9132b9 commit c1a5211
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/scripts/vim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ window.addEventListener("keydown", (e) => {
}

// vim motion (j and k)
if (pathname == "/blogs") {
if (pathname == "/blogs" && blogs.length > 0) {
// move the pointer
if (e.key == "j") blogsPointer++;
else if (e.key == "k") blogsPointer--;
Expand Down

0 comments on commit c1a5211

Please sign in to comment.