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 | |
parent | e05e7ef2f6b04269d8c892907159e70cd0947a06 (diff) |
Added F3 key functionality to jump to random group/entry
-rw-r--r-- | docs/tml.1.gz | bin | 957 -> 971 bytes | |||
-rw-r--r-- | draw.c | 8 | ||||
-rw-r--r-- | tasklist.md | 2 |
3 files changed, 10 insertions, 0 deletions
diff --git a/docs/tml.1.gz b/docs/tml.1.gz Binary files differindex 466656d..33c4e83 100644 --- a/docs/tml.1.gz +++ b/docs/tml.1.gz @@ -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); 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 |