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