From e58f35f4580ad4377c3ba5dcaee5bbbd938713c6 Mon Sep 17 00:00:00 2001 From: lshprung Date: Sat, 11 Sep 2021 10:02:17 -0700 Subject: Added F3 key functionality to jump to random group/entry --- docs/tml.1.gz | Bin 957 -> 971 bytes draw.c | 8 ++++++++ tasklist.md | 2 ++ 3 files changed, 10 insertions(+) diff --git a/docs/tml.1.gz b/docs/tml.1.gz index 466656d..33c4e83 100644 Binary files a/docs/tml.1.gz and b/docs/tml.1.gz differ diff --git a/draw.c b/draw.c index daba27e..34ac2ce 100644 --- a/draw.c +++ b/draw.c @@ -1,6 +1,7 @@ #include #include #include +#include #include //Windows/Unix Compatability @@ -55,6 +56,8 @@ int main(int argc, char **argv){ int prev_height; //used to check if the window was resized int i; + srand(time(NULL)); + flags_set = handle_args(argc, argv, &cfg_path); if(flags_set[1]) return(0); //exit if help flag was passed if(flags_set[2]) freopen("/dev/null", "w", stdout); //turn off output if quiet flag was passed @@ -144,6 +147,11 @@ int main(int argc, char **argv){ trav_col((true_hover ? e_count : g_count)-1); break; + case KEY_F(3): + //jump to random group/entry + trav_col(rand() % (true_hover ? e_count : g_count)); + break; + case KEY_F(5): //manual refresh (for debug purposes) update_display(true); diff --git a/tasklist.md b/tasklist.md index d9385a2..ff44f10 100644 --- a/tasklist.md +++ b/tasklist.md @@ -20,3 +20,5 @@ ### Completed - Create a task list to keep track of ideas and bugs - Added in commit `c21fbd4582ef016c4b195bfa7db8727914befb15` +- Add "random" key to jump to a random group/entry + - Added as F3 -- cgit