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

4
nnn.1
View file

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

16
nnn.c
View file

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