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
+4 -2
View File
@@ -334,10 +334,9 @@ note_selection:
// this loop is the note selector
int filesCount = 0;
char **filesArray = getNotesFromVault(notesDirectoryString, vaultSelected, journalRegex, &filesCount, shouldDebug);
qsort(filesArray, filesCount, sizeof(const char *), compareString); // sorts the notes alphabetically
int journalCount = 0;
char **journalArray = getJournalsFromVault(notesDirectoryString, vaultSelected, journalRegex, &journalCount, shouldDebug);
qsort(journalArray, journalCount, sizeof(const char *), compareString);
// appends the journal at the end of filesArray
filesArray = realloc(filesArray, (filesCount + journalCount)*sizeof(char*));
@@ -345,6 +344,9 @@ note_selection:
filesArray[i + filesCount] = journalArray[i];
}
filesCount = filesCount + journalCount;
// we sort them // (TODO LATER) THis doesn't seem to sort them
qsort(filesArray, filesCount, sizeof(const char *), compareString);
debug("Available notes and journals:");
if (shouldDebug) {
for (int i = 0; i < filesCount; i++) {