Browse Source

Revert "Handle nav cases separately"

This reverts commit 1430993858.
master
Arun Prakash Jana 5 years ago
parent
commit
729e775998
1 changed files with 34 additions and 25 deletions
  1. +34
    -25
      src/nnn.c

+ 34
- 25
src/nnn.c View File

@@ -2974,33 +2974,42 @@ nochange:
printmsg("unsupported file"); printmsg("unsupported file");
goto nochange; goto nochange;
} }
case SEL_NEXT:
if (cur < ndents - 1)
++cur;
else if (ndents)
/* Roll over, set cursor to first entry */
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;
else if (ndents)
/* Roll over, set cursor to first entry */
cur = 0;
break;
case SEL_PREV:
if (cur > 0)
--cur;
else if (ndents)
/* Roll over, set cursor to last entry */
cur = ndents - 1;
break;
case SEL_PGDN:
if (cur < ndents - 1)
cur += MIN((LINES - 4) / 2, ndents - 1 - cur);
break;
case SEL_PGUP:
if (cur > 0)
cur -= MIN((LINES - 4) / 2, cur);
break;
case SEL_HOME:
cur = 0; cur = 0;
break;
case SEL_PREV:
if (cur > 0)
--cur;
else if (ndents)
/* Roll over, set cursor to last entry */
break;
default: /* case SEL_END */
cur = ndents - 1; cur = ndents - 1;
break;
case SEL_PGDN:
if (cur < ndents - 1)
cur += MIN((LINES - 4) / 2, ndents - 1 - cur);
break;
case SEL_PGUP:
if (cur > 0)
cur -= MIN((LINES - 4) / 2, cur);
break;
case SEL_HOME:
cur = 0;
break;
case SEL_END:
cur = ndents - 1;
break;
}
break; break;
case SEL_CDHOME: // fallthrough case SEL_CDHOME: // fallthrough
case SEL_CDBEGIN: // fallthrough case SEL_CDBEGIN: // fallthrough


Loading…
Cancel
Save