diff options
author | lshprung <lshprung@yahoo.com> | 2021-09-11 10:02:17 -0700 |
---|---|---|
committer | lshprung <lshprung@yahoo.com> | 2021-09-11 10:02:17 -0700 |
commit | e58f35f4580ad4377c3ba5dcaee5bbbd938713c6 (patch) | |
tree | c6d31c719e030b71492b05fdb8c999971f172b07 /draw.c | |
parent | e05e7ef2f6b04269d8c892907159e70cd0947a06 (diff) |
Added F3 key functionality to jump to random group/entry
Diffstat (limited to 'draw.c')
-rw-r--r-- | draw.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -1,6 +1,7 @@ #include <stdbool.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include <unistd.h> //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); |