Remove file from marked after remove
This commit is contained in:
parent
3e95b7ab9c
commit
42751778ac
2 changed files with 5 additions and 1 deletions
3
ccc.c
3
ccc.c
|
@ -1075,6 +1075,9 @@ void delete_files()
|
||||||
change_dir(cwd, 0, 0);
|
change_dir(cwd, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < marked->length; i++) {
|
||||||
|
arraylist_remove(marked, 0);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
wpprintw("TODO: implement hard delete");
|
wpprintw("TODO: implement hard delete");
|
||||||
}
|
}
|
||||||
|
|
3
file.c
3
file.c
|
@ -60,12 +60,13 @@ void arraylist_remove(ArrayList *list, long index)
|
||||||
if (index >= list->length)
|
if (index >= list->length)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
/* marked stuff doesn't work with this
|
||||||
free(list->items[index].name);
|
free(list->items[index].name);
|
||||||
free(list->items[index].path);
|
free(list->items[index].path);
|
||||||
free(list->items[index].type);
|
free(list->items[index].type);
|
||||||
free(list->items[index].stats);
|
free(list->items[index].stats);
|
||||||
free(list->items[index].icon);
|
free(list->items[index].icon);
|
||||||
|
*/
|
||||||
for (long i = index; i < list->length - 1; i++)
|
for (long i = index; i < list->length - 1; i++)
|
||||||
list->items[i] = list->items[i + 1];
|
list->items[i] = list->items[i + 1];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue