From 42751778accc288e17fa4bc2978603b3cf71b027 Mon Sep 17 00:00:00 2001 From: night0721 Date: Fri, 11 Oct 2024 20:03:31 +0100 Subject: [PATCH] Remove file from marked after remove --- ccc.c | 3 +++ file.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ccc.c b/ccc.c index 1dcb128..58717da 100644 --- a/ccc.c +++ b/ccc.c @@ -1075,6 +1075,9 @@ void delete_files() change_dir(cwd, 0, 0); } } + for (int i = 0; i < marked->length; i++) { + arraylist_remove(marked, 0); + } } else { wpprintw("TODO: implement hard delete"); } diff --git a/file.c b/file.c index 5d32e32..7524381 100644 --- a/file.c +++ b/file.c @@ -60,12 +60,13 @@ void arraylist_remove(ArrayList *list, long index) if (index >= list->length) return; + /* marked stuff doesn't work with this free(list->items[index].name); free(list->items[index].path); free(list->items[index].type); free(list->items[index].stats); free(list->items[index].icon); - + */ for (long i = index; i < list->length - 1; i++) list->items[i] = list->items[i + 1];