Toggle help and file details screens with same key

This commit is contained in:
Arun Prakash Jana 2017-04-10 18:35:30 +05:30
parent a569d383bc
commit f2a5002fa9
No known key found for this signature in database
GPG key ID: A75979F35C080412
3 changed files with 12 additions and 16 deletions

View file

@ -149,7 +149,7 @@ Start nnn (default: current directory):
| `/`, `&` | Filter dir contents |
| `c` | Show change dir prompt |
| `d` | Toggle detail view |
| `D` | Show details of selected file |
| `D` | Toggle current file details screen |
| `.` | Toggle hide .dot files |
| `s` | Toggle sort by file size |
| `S` | Toggle disk usage analyzer mode |
@ -160,7 +160,7 @@ Start nnn (default: current directory):
| `p` | Open entry in `PAGER` (fallback less) |
| `^K` | Invoke file name copier |
| `^L` | Force a redraw |
| `?` | Show help |
| `?` | Toggle help screen |
| `q` | Quit |
### Filters

4
nnn.1
View file

@ -49,7 +49,7 @@ Change into the given directory
.It Ic d
Toggle detail view
.It Ic D
Show details of selected file
Toggle current file details screen
.It Ic \&.
Toggle hide .dot files
.It Ic s
@ -71,7 +71,7 @@ Invoke file name copier
.It Ic ^L
Force a redraw
.It Ic \&?
Show help
Toggle help screen
.It Ic q
Quit
.El

16
nnn.c
View file

@ -877,10 +877,8 @@ show_stats(char* fpath, char* fname, struct stat *sb)
}
/* Show exit keys */
printw("\n\n << (q/Esc)");
for (*buf = getch(); *buf != 'q' && *buf != 27; *buf = getch())
if (*buf == 'q' || *buf == 27)
printw("\n\n << (D)");
while ((*buf = getch()) != 'D');
return;
}
@ -906,7 +904,7 @@ show_help(void)
/, & Filter dir contents\n\
c Show change dir prompt\n\
d Toggle detail view\n\
D Show details of selected file\n\
D Toggle current file details screen\n\
. Toggle hide .dot files\n\
s Toggle sort by file size\n\
S Toggle disk usage analyzer mode\n\
@ -917,14 +915,12 @@ show_help(void)
p Open entry in PAGER (fallback less)\n\
^K Invoke file name copier\n\
^L Force a redraw\n\
? Show help\n\
? Toggle help screen\n\
q Quit\n");
/* Show exit keys */
printw("\n\n << (q/Esc)");
for (c = getch(); c != 'q' && c != 27; c = getch())
if (c == 'q' || c == 27)
printw("\n\n << (?)");
while ((c = getch()) != '?');
return;
}