Added fzf search for journals

This commit is contained in:
Tomas Rivera
2026-04-16 18:39:44 +02:00
parent 17fb5edd48
commit cdf2e086e0
8 changed files with 152 additions and 19 deletions
+5
View File
@@ -12,6 +12,9 @@
#include <limits.h>
#include <regex.h>
#include "utils.h"
#define CMD_BUFFER 4096 // for fzfSelect
#define RESULT_BUFFER 1024 // for fzfSelect
/*Uses ncurses to get an input from the user.
Creates a new note with this input.
also can create a journal if the name matches with journalRegex.
@@ -24,6 +27,8 @@ Creates a new vault with this input.
If vault already exists, prints a warning.
returns nothing. */
void createNewVault(char *dirToVault, int bypass, char *bypassvalue, int debug);
// uses fzf and ripgrep to search inside the files to choose between all the options.
char* fzfSelect(char *pathToFiles, char *selectText, int shouldDebug);
/*this function is used multiple times let the user select one options from many with ncurses in a TUI.
options is the array of strings with all the options.
optionsText is the text that will be printed at the top (For example: "Please select ...").