mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Reduce indentation level
This commit is contained in:
parent
9995facfb9
commit
c19706006d
|
@ -51,7 +51,7 @@ Have fun with it! Missing a feature? Want to contribute? Head to the rolling [To
|
||||||
- [Keyboard shortcuts](#keyboard-shortcuts)
|
- [Keyboard shortcuts](#keyboard-shortcuts)
|
||||||
- [Filters](#filters)
|
- [Filters](#filters)
|
||||||
- [Navigate-as-you-type mode](#navigate-as-you-type-mode)
|
- [Navigate-as-you-type mode](#navigate-as-you-type-mode)
|
||||||
- [File type abbreviations](#file-type-abbreviations)
|
- [File indicators](#file-indicators)
|
||||||
- [File handling](#file-handling)
|
- [File handling](#file-handling)
|
||||||
- [Help](#help)
|
- [Help](#help)
|
||||||
- [Quickstart](#quickstart)
|
- [Quickstart](#quickstart)
|
||||||
|
@ -276,11 +276,11 @@ If `nnn` is invoked as root or the environment variable `NNN_SHOW_HIDDEN` is set
|
||||||
|
|
||||||
In this mode directories are opened in filter mode, allowing continuous navigation. Works best with the **arrow keys**.
|
In this mode directories are opened in filter mode, allowing continuous navigation. Works best with the **arrow keys**.
|
||||||
|
|
||||||
#### File type abbreviations
|
#### File indicators
|
||||||
|
|
||||||
The following abbreviations are used in the detail view:
|
The following indicators are used in the detail view:
|
||||||
|
|
||||||
| Symbol | File Type |
|
| Indicator | File Type |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `/` | Directory |
|
| `/` | Directory |
|
||||||
| `*` | Executable |
|
| `*` | Executable |
|
||||||
|
|
28
nnn.c
28
nnn.c
|
@ -1210,7 +1210,8 @@ xreadline(char *fname, char *prompt)
|
||||||
mvaddnwstr(y, x, buf, len + 1);
|
mvaddnwstr(y, x, buf, len + 1);
|
||||||
move(y, x + wcswidth(buf, pos));
|
move(y, x + wcswidth(buf, pos));
|
||||||
|
|
||||||
if ((r = get_wch(ch)) != ERR) {
|
r = get_wch(ch);
|
||||||
|
if (r != ERR) {
|
||||||
if (r == OK) {
|
if (r == OK) {
|
||||||
switch (*ch) {
|
switch (*ch) {
|
||||||
case KEY_ENTER: //fallthrough
|
case KEY_ENTER: //fallthrough
|
||||||
|
@ -2982,9 +2983,14 @@ nochange:
|
||||||
copycurname();
|
copycurname();
|
||||||
goto begin;
|
goto begin;
|
||||||
case SEL_COPY:
|
case SEL_COPY:
|
||||||
if (!(cfg.noxdisplay || copier))
|
if (!(cfg.noxdisplay || copier)) {
|
||||||
printmsg(messages[STR_COPY_ID]);
|
printmsg(messages[STR_COPY_ID]);
|
||||||
else if (ndents) {
|
goto nochange;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ndents)
|
||||||
|
goto nochange;
|
||||||
|
|
||||||
if (cfg.copymode) {
|
if (cfg.copymode) {
|
||||||
r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
|
r = mkpath(path, dents[cur].name, newpath, PATH_MAX);
|
||||||
if (!appendfpath(newpath, r))
|
if (!appendfpath(newpath, r))
|
||||||
|
@ -3012,12 +3018,16 @@ nochange:
|
||||||
spawn(copier, newpath, NULL, NULL, F_NOTRACE);
|
spawn(copier, newpath, NULL, NULL, F_NOTRACE);
|
||||||
printmsg(newpath);
|
printmsg(newpath);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
goto nochange;
|
goto nochange;
|
||||||
case SEL_COPYMUL:
|
case SEL_COPYMUL:
|
||||||
if (!(cfg.noxdisplay || copier))
|
if (!(cfg.noxdisplay || copier)) {
|
||||||
printmsg(messages[STR_COPY_ID]);
|
printmsg(messages[STR_COPY_ID]);
|
||||||
else if (ndents) {
|
goto nochange;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!ndents)
|
||||||
|
goto nochange;
|
||||||
|
|
||||||
cfg.copymode ^= 1;
|
cfg.copymode ^= 1;
|
||||||
if (cfg.copymode) {
|
if (cfg.copymode) {
|
||||||
g_crc = crc8fast((uchar *)dents, ndents * sizeof(struct entry));
|
g_crc = crc8fast((uchar *)dents, ndents * sizeof(struct entry));
|
||||||
|
@ -3026,7 +3036,9 @@ nochange:
|
||||||
ncp = 0;
|
ncp = 0;
|
||||||
printmsg("multi-copy on");
|
printmsg("multi-copy on");
|
||||||
DPRINTF_S("copymode on");
|
DPRINTF_S("copymode on");
|
||||||
} else {
|
goto nochange;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ncp) { /* Handle range selection */
|
if (!ncp) { /* Handle range selection */
|
||||||
if (cur < copystartid) {
|
if (cur < copystartid) {
|
||||||
copyendid = copystartid;
|
copyendid = copystartid;
|
||||||
|
@ -3056,8 +3068,6 @@ nochange:
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
printmsg("multi-copy off");
|
printmsg("multi-copy off");
|
||||||
}
|
|
||||||
}
|
|
||||||
goto nochange;
|
goto nochange;
|
||||||
case SEL_QUOTE:
|
case SEL_QUOTE:
|
||||||
cfg.quote ^= 1;
|
cfg.quote ^= 1;
|
||||||
|
|
Loading…
Reference in a new issue