]> git.armaanb.net Git - lightcards.git/commitdiff
Add keybindings to go to start and end of stack
authorArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 04:02:31 +0000 (23:02 -0500)
committerArmaan Bhojwani <me@armaanb.net>
Sun, 31 Jan 2021 04:02:31 +0000 (23:02 -0500)
lightcards/display.py

index a4d6f2b9237e97c1b30b4bfb8708fa4c2d437212..aa331b107ad12b7a7afb2cbd40d94b1c67953a25 100755 (executable)
@@ -98,3 +98,9 @@ def get_key(stdscr, stack, headers, idx):
         elif key in ["i", "/"]:
             stack[idx.getIdx()].toggleStar()
             disp_card(stdscr, stack, headers, idx)
+        elif key in ["0", "^", "KEY_HOME"]:
+            idx.setIdx(0)
+            disp_card(stdscr, stack, headers, idx)
+        elif key in ["$", "KEY_END"]:
+            idx.setIdx(len(stack) - 1)
+            disp_card(stdscr, stack, headers, idx)