diff --git a/dir.c b/dir.c index fc26f65..69807ad 100644 --- a/dir.c +++ b/dir.c @@ -317,7 +317,14 @@ void dir_changed(){ } } +void deselect_all_files() { + unsigned long i; + for (i = 0; i < mid_dir.file_count; i++) { + mid_dir.file_list[i].status &= ~FILE_STATUS_SELECTED; + } +} void change_dir(char *new_path){ + deselect_all_files(); current_linked_dir = list_beginning; while (current_linked_dir->next != NULL) { diff --git a/dir.h b/dir.h index a375618..7cd8bd1 100644 --- a/dir.h +++ b/dir.h @@ -9,4 +9,5 @@ void print_dir(WINDOW *win, char print_info, dir *dir); char update_selected_file(); void dir_set_selected_file_current(unsigned long selected_file_current); unsigned long dir_get_selected_file_current(); +void deselect_all_files(); void dir_init(); diff --git a/interactions.c b/interactions.c index 70079fb..763540e 100644 --- a/interactions.c +++ b/interactions.c @@ -356,6 +356,8 @@ void delete(unsigned long passes){ } } + deselect_all_files(); + status |= (STATUS_RUN_BACKEND | STATUS_RELOAD_DIRECTORY); } void makedir(){