1
1

Added some keybindings and changed 'h' to 'e' in browser

Этот коммит содержится в:
Yorhel 2009-10-18 12:52:00 +02:00
родитель adaf8a6098
Коммит 06cab8cc30
5 изменённых файлов: 25 добавлений и 10 удалений

Просмотреть файл

@ -8,6 +8,7 @@ git - ?
- Properly display MiB units instead of MB (IEEE 1541 - bug #2831412)
- Link to ncursesw when available
- Improved support for non-ASCII characters
- VIM keybindings for browsing through the tree (#2788249, #1880622)
1.5 - 2009-05-02
- Fixed incorrect apparent size on directory refresh

Просмотреть файл

@ -43,13 +43,13 @@ should be seperated by a newline.
\fB?\fP
Show help + keys + about screen
.TP
\fBup/down\fP
\fBup, down j, k\fP
Cycle through the items
.TP
\fBright/enter\fP
\fBright, enter, l\fP
Open selected directory
.TP
\fBleft\fP
\fBleft, <, h\fP
Go to parent directory
.TP
\fBn\fP
@ -74,7 +74,7 @@ Toggle between showing percentage, graph, both, or none. Percentage
is relative to the size of the current directory, graph is relative
to the largest item in the current directory.
.TP
\fBh\fP
\fBe\fP
Show/hide 'hidden' or 'excluded' files and directories. Please note that
even though you can't see the hidden files and directories, they are still
there and they are still included in the directory sizes. If you suspect

Просмотреть файл

@ -347,9 +347,11 @@ int browse_key(int ch) {
switch(ch) {
/* selecting items */
case KEY_UP:
case 'k':
browse_key_sel(-1);
break;
case KEY_DOWN:
case 'j':
browse_key_sel(1);
break;
case KEY_HOME:
@ -383,7 +385,7 @@ int browse_key(int ch) {
sort++;
nonfo++;
break;
case 'h':
case 'e':
toggle(flags, BF_HIDE);
browse_key_sel(0);
nonfo++;
@ -401,6 +403,7 @@ int browse_key(int ch) {
/* browsing */
case 10:
case KEY_RIGHT:
case 'l':
for(n=browse_dir; n!=NULL; n=n->next)
if(n->flags & FF_BSEL)
break;
@ -416,6 +419,8 @@ int browse_key(int ch) {
nonfo++;
break;
case KEY_LEFT:
case 'h':
case '<':
if(browse_dir != NULL && browse_dir->parent->parent != NULL) {
browse_dir = browse_dir->parent->parent->sub;
sort++;

Просмотреть файл

@ -112,10 +112,12 @@ int delete_key(int ch) {
if(state == DS_CONFIRM)
switch(ch) {
case KEY_LEFT:
case 'h':
if(--seloption < 0)
seloption = 0;
break;
case KEY_RIGHT:
case 'l':
if(++seloption > 2)
seloption = 2;
break;
@ -139,10 +141,12 @@ int delete_key(int ch) {
else if(state == DS_FAILED)
switch(ch) {
case KEY_LEFT:
case 'h':
if(--seloption < 0)
seloption = 0;
break;
case KEY_RIGHT:
case 'l':
if(++seloption > 2)
seloption = 2;
break;

Просмотреть файл

@ -32,19 +32,20 @@
int page, start;
#define KEYS 13
#define KEYS 14
char *keys[KEYS*2] = {
/*|----key----| |----------------description----------------|*/
"up/down", "Cycle through the items",
"right/enter", "Open directory",
"left", "Previous directory",
"up, k", "Move cursor up",
"down, j", "Move cursor down",
"right/enter", "Open selected directory",
"left, <, h", "Open parent directory",
"n", "Sort by name (ascending/descending)",
"s", "Sort by size (ascending/descending)",
"d", "Delete selected file or directory",
"t", "Toggle dirs before files when sorting",
"g", "Show percentage and/or graph",
"a", "Toggle between apparent size and disk usage",
"h", "Show/hide hidden or excluded files",
"e", "Show/hide hidden or excluded files",
"i", "Show information about selected item",
"r", "Recalculate the current directory",
"q", "Quit ncdu"
@ -166,22 +167,26 @@ int help_key(int ch) {
break;
case KEY_RIGHT:
case KEY_NPAGE:
case 'l':
if(++page > 3)
page = 3;
start = 0;
break;
case KEY_LEFT:
case KEY_PPAGE:
case 'h':
if(--page < 1)
page = 1;
start = 0;
break;
case KEY_DOWN:
case ' ':
case 'j':
if(start < KEYS-10)
start++;
break;
case KEY_UP:
case 'k':
if(start > 0)
start--;
break;