mirror of
https://gittea.dev/nova/th.git
synced 2025-10-21 18:30:15 -04:00
handling of empty dirs
This commit is contained in:
11
dir.c
11
dir.c
@@ -314,6 +314,9 @@ void print_dir(WINDOW *win, char print_info, unsigned long *dir_file_count, file
|
||||
}
|
||||
|
||||
void update_selected_file(){
|
||||
if (mid_content->file_name[0] == '\0') { /* only happens if the current path is either empty or inaccessible */
|
||||
return;
|
||||
}
|
||||
if (selected_file_current >= mid_file_count) {
|
||||
selected_file_current = mid_file_count-1;
|
||||
}
|
||||
@@ -324,11 +327,17 @@ void update_selected_file(){
|
||||
selected_file_last = selected_file_current;
|
||||
}
|
||||
void dir_set_selected_file_current(unsigned long selected_file_current){
|
||||
current_dir->selected_file_current = selected_file_current;
|
||||
if (mid_content->file_name[0] != '\0') {
|
||||
current_dir->selected_file_current = selected_file_current;
|
||||
}
|
||||
}
|
||||
|
||||
unsigned long dir_get_selected_file_current(){
|
||||
|
||||
current_dir = visited_dirs;
|
||||
if (mid_content->file_name[0] == '\0') {
|
||||
return 0;
|
||||
}
|
||||
char hit = 0;
|
||||
char *path = getcwd(NULL, 0);
|
||||
while(current_dir->next != NULL) {
|
||||
|
Reference in New Issue
Block a user