mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Combine navigation case
This commit is contained in:
parent
c400a19268
commit
a8234f26e8
36
src/nnn.c
36
src/nnn.c
|
@ -2797,6 +2797,13 @@ nochange:
|
|||
printmsg("unsupported file");
|
||||
goto nochange;
|
||||
}
|
||||
case SEL_NEXT: // fallthrough
|
||||
case SEL_PREV: // fallthrough
|
||||
case SEL_PGDN: // fallthrough
|
||||
case SEL_PGUP: // fallthrough
|
||||
case SEL_HOME: // fallthrough
|
||||
case SEL_END:
|
||||
switch (sel) {
|
||||
case SEL_NEXT:
|
||||
if (cur < ndents - 1)
|
||||
++cur;
|
||||
|
@ -2822,20 +2829,29 @@ nochange:
|
|||
case SEL_HOME:
|
||||
cur = 0;
|
||||
break;
|
||||
case SEL_END:
|
||||
default: /* case SEL_END */
|
||||
cur = ndents - 1;
|
||||
break;
|
||||
case SEL_CDHOME:
|
||||
dir = xgetenv("HOME", path); // fallthrough
|
||||
case SEL_CDBEGIN:
|
||||
if (sel == SEL_CDBEGIN)
|
||||
dir = ipath; // fallthrough
|
||||
case SEL_CDLAST:
|
||||
if (sel == SEL_CDLAST)
|
||||
dir = lastdir; // fallthrough
|
||||
}
|
||||
break;
|
||||
case SEL_CDHOME: // fallthrough
|
||||
case SEL_CDBEGIN: // fallthrough
|
||||
case SEL_CDLAST: // fallthrough
|
||||
case SEL_VISIT:
|
||||
if (sel == SEL_VISIT)
|
||||
switch (sel) {
|
||||
case SEL_CDHOME:
|
||||
dir = xgetenv("HOME", path);
|
||||
break;
|
||||
case SEL_CDBEGIN:
|
||||
dir = ipath;
|
||||
break;
|
||||
case SEL_CDLAST:
|
||||
dir = lastdir;
|
||||
break;
|
||||
default: /* case SEL_VISIT */
|
||||
dir = mark;
|
||||
break;
|
||||
}
|
||||
|
||||
if (dir[0] == '\0') {
|
||||
printmsg("not set");
|
||||
|
|
Loading…
Reference in a new issue