1
0
mirror of https://gittea.dev/nova/th.git synced 2025-10-21 18:30:15 -04:00

search file function now does file previews

This commit is contained in:
nova
2025-08-24 20:09:32 +02:00
parent 4a9c38d034
commit a05c3ecd96
3 changed files with 13 additions and 5 deletions

9
dir.c
View File

@@ -313,18 +313,23 @@ void print_dir(WINDOW *win, char print_info, unsigned long *dir_file_count, file
free(bg);
}
void update_selected_file(){
char update_selected_file(){
char ret = -1; /* -1 on empty or inaccessible file, 0 on unchanged file, 1 on changed file */
if (mid_content->file_name[0] == '\0') { /* only happens if the current path is either empty or inaccessible */
return;
return ret;
}
if (selected_file_current >= mid_file_count) {
selected_file_current = mid_file_count-1;
}
if (selected_file_current != selected_file_last) {
mid_content[selected_file_last].status &= ~FILE_STATUS_HOVER;
ret = 1;
} else {
ret = 0;
}
mid_content[selected_file_current].status |= FILE_STATUS_HOVER;
selected_file_last = selected_file_current;
return ret;
}
void dir_set_selected_file_current(unsigned long selected_file_current){
if (mid_content->file_name[0] != '\0') {