mirror of
https://github.com/tomasriveral/NoteWrapper.git
synced 2026-08-12 02:18:38 +02:00
format: fix
This commit is contained in:
+6
-6
@@ -719,12 +719,12 @@ backup_config_end:
|
|||||||
// we can just go back to open_note
|
// we can just go back to open_note
|
||||||
goto open_note;
|
goto open_note;
|
||||||
} else if (strcmp(noteSelected, "Search inside the vault") == 0) {
|
} else if (strcmp(noteSelected, "Search inside the vault") == 0) {
|
||||||
char *vaultPath = malloc(PATH_MAX);
|
char *vaultPath = malloc(PATH_MAX);
|
||||||
snprintf(vaultPath, PATH_MAX, "%s/%s/", notesDirectoryString, vaultSelected);
|
snprintf(vaultPath, PATH_MAX, "%s/%s/", notesDirectoryString, vaultSelected);
|
||||||
char *result = fzfSelect(vaultPath, "Input text to be searched", shouldDebug);
|
char *result = fzfSelect(vaultPath, "Input text to be searched", shouldDebug);
|
||||||
bypassSelectionNote = 1;
|
bypassSelectionNote = 1;
|
||||||
bypassSelectionNoteValue = result;
|
bypassSelectionNoteValue = result;
|
||||||
free(vaultPath);
|
free(vaultPath);
|
||||||
} else if (strcmp(noteSelected, "Back to vault selection") == 0) {
|
} else if (strcmp(noteSelected, "Back to vault selection") == 0) {
|
||||||
shouldChangeVault = 1;
|
shouldChangeVault = 1;
|
||||||
} else if (strcmp(noteSelected, "Delete vault") == 0) {
|
} else if (strcmp(noteSelected, "Delete vault") == 0) {
|
||||||
|
|||||||
@@ -218,16 +218,15 @@ char *fzfSelect(char *pathToFiles, char *selectText, int shouldDebug) {
|
|||||||
int pathToFilesLen = strlen(pathToFiles);
|
int pathToFilesLen = strlen(pathToFiles);
|
||||||
int cutOut = 0;
|
int cutOut = 0;
|
||||||
for (int i = 0; i < pathToFilesLen; i++) {
|
for (int i = 0; i < pathToFilesLen; i++) {
|
||||||
if (pathToFiles[i] == result[i]) {
|
if (pathToFiles[i] == result[i]) {
|
||||||
cutOut = i;
|
cutOut = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result += cutOut + 1; // the + 1 cuts the first /
|
result += cutOut + 1; // the + 1 cuts the first /
|
||||||
|
|
||||||
// in case we select a journal, we won't open the entry just yet. We only need to return the journal name (everything before [now the first] /
|
// in case we select a journal, we won't open the entry just yet. We only need to return the journal name (everything before [now the first] /
|
||||||
result = strtok(result, "/");
|
result = strtok(result, "/");
|
||||||
|
|
||||||
|
|
||||||
debug("Cleaned note: %s", result);
|
debug("Cleaned note: %s", result);
|
||||||
|
|
||||||
// clean up
|
// clean up
|
||||||
|
|||||||
Reference in New Issue
Block a user