mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
change D semantics to clear the current directory instead of the selected one
This commit is contained in:
parent
0a230cdd1c
commit
347cfde59a
4 changed files with 12 additions and 9 deletions
|
|
@ -180,6 +180,10 @@ Delete the selected file or directory. An error message will be shown when the
|
|||
contents of the directory do not match or do not exist anymore on the
|
||||
filesystem.
|
||||
|
||||
=item D
|
||||
|
||||
Clears the current directory, deleting all of its content.
|
||||
|
||||
=item t
|
||||
|
||||
Toggle dirs before files when sorting.
|
||||
|
|
|
|||
|
|
@ -435,13 +435,8 @@ int browse_key(int ch) {
|
|||
: "Folder clearing not available for imported directories.";
|
||||
break;
|
||||
}
|
||||
if(sel == NULL || sel == dirlist_parent)
|
||||
break;
|
||||
if (!(sel->flags & FF_DIR)) {
|
||||
message = "You can only clear folders";
|
||||
}
|
||||
info_show = 0;
|
||||
delete_init(sel, t, 1);
|
||||
delete_init(dirlist_par, NULL, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -249,8 +249,11 @@ void delete_process() {
|
|||
delete_dir(root);
|
||||
if(nextsel)
|
||||
nextsel->flags |= FF_BSEL;
|
||||
browse_init(par);
|
||||
if(!_clear && nextsel)
|
||||
if (_clear)
|
||||
browse_init(root);
|
||||
else
|
||||
browse_init(par);
|
||||
if(nextsel)
|
||||
dirlist_top(-4);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
int page, start;
|
||||
|
||||
|
||||
#define KEYS 16
|
||||
#define KEYS 17
|
||||
char *keys[KEYS*2] = {
|
||||
/*|----key----| |----------------description----------------|*/
|
||||
"up, k", "Move cursor up",
|
||||
|
|
@ -43,6 +43,7 @@ char *keys[KEYS*2] = {
|
|||
"s", "Sort by size (ascending/descending)",
|
||||
"C", "Sort by items (ascending/descending)",
|
||||
"d", "Delete selected file or directory",
|
||||
"D", "Clears the files in the current directory",
|
||||
"t", "Toggle dirs before files when sorting",
|
||||
"g", "Show percentage and/or graph",
|
||||
"a", "Toggle between apparent size and disk usage",
|
||||
|
|
|
|||
Loading…
Reference in a new issue