README.md | 3 +--
src/nnn.c | 33 ++++++++++++++++-----------------
src/nnn.h | 2 +-
diff --git a/README.md b/README.md
index 957b82d4ab2eb342518dc6528b5f093afd8171d8..ec61b5ffab2e165d0d9a211eef2b6bf88a26dee0 100644
--- a/README.md
+++ b/README.md
@@ -213,7 +213,7 @@ (Sh)Tab Cycle context d Detail view toggle
, ^/ Lead key N LeadN Context N
/ Filter/Lead Ins ^N Nav-as-you-type toggle
Esc Exit prompt ^L F5 Redraw/clear prompt
- ? Help, conf ' Lead' First file
+ ? Help, conf ' First file
Q ^Q Quit ^G QuitCD q Quit context
FILES
^O Open with... n Create new/link
@@ -257,7 +257,6 @@ | Follower key | Function |
|:---:| --- |
| 1-4 | Go to/create selected context |
| key | Go to bookmarked location |
-| ' | Go to first file in directory |
| ~ ` @ - | Visit HOME, `/`, start, last visited dir |
| . | Toggle show hidden files |
diff --git a/src/nnn.c b/src/nnn.c
index 3465c968e086da0a814ade18fd49803fc9fda47a..8f6b2291c25c5c9dbe23da3be8ba0cce064a2cb6 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -3491,7 +3491,7 @@ "6(Sh)Tab Cycle context d Detail view toggle\n"
"9, ^/ Lead key N LeadN Context N\n"
"c/ Filter/Lead Ins ^N Nav-as-you-type toggle\n"
"aEsc Exit prompt ^L F5 Redraw/clear prompt\n"
- "c? Help, conf ' Lead' First file\n"
+ "c? Help, conf ' First file\n"
"9Q ^Q Quit ^G QuitCD q Quit context\n"
"1FILES\n"
"b^O Open with... n Create new/link\n"
@@ -4008,9 +4008,21 @@ break;
case SEL_HOME:
move_cursor(0, 1);
break;
- default: /* case SEL_END: */
+ case SEL_END:
move_cursor(ndents - 1, 1);
break;
+ default: /* case SEL_FIRST */
+ {
+ int r = 0;
+
+ for (; r < ndents; ++r) {
+ if (!(dents[r].flags & DIR_OR_LINK_TO_DIR)) {
+ move_cursor((r) % ndents, 0);
+ break;
+ }
+ }
+ break;
+ }
}
}
@@ -4495,7 +4507,8 @@ case SEL_CTRL_D: // fallthrough
case SEL_PGUP: // fallthrough
case SEL_CTRL_U: // fallthrough
case SEL_HOME: // fallthrough
- case SEL_END:
+ case SEL_END: // fallthrough
+ case SEL_FIRST:
handle_screen_move(sel);
break;
case SEL_CDHOME: // fallthrough
@@ -4548,7 +4561,6 @@ goto begin;
case SEL_LEADER: // fallthrough
case SEL_CYCLE: // fallthrough
case SEL_CYCLER: // fallthrough
- case SEL_FIRST: // fallthrough
case SEL_CTX1: // fallthrough
case SEL_CTX2: // fallthrough
case SEL_CTX3: // fallthrough
@@ -4559,9 +4571,6 @@ fd = '\t';
break;
case SEL_CYCLER:
fd = KEY_BTAB;
- break;
- case SEL_FIRST:
- fd = '\'';
break;
case SEL_CTX1: // fallthrough
case SEL_CTX2: // fallthrough
@@ -4579,16 +4588,6 @@ case '`': // fallthrough
case '-': // fallthrough
case '@':
presel = fd;
- goto nochange;
- case '\'': /* jump to first file in the directory */
- for (r = 0; r < ndents; ++r) {
- if (!(dents[r].flags & DIR_OR_LINK_TO_DIR)) {
- move_cursor((r) % ndents, 0);
- break;
- }
- }
- if (r != ndents)
- continue;
goto nochange;
case '.':
cfg.showhidden ^= 1;
diff --git a/src/nnn.h b/src/nnn.h
index 1c3a6858395b3267d5ad58f99826b3e1d445349e..e7d1ab0257c0a1dd7b459b8cbffa3e010845e27f 100644
--- a/src/nnn.h
+++ b/src/nnn.h
@@ -161,7 +161,7 @@ /* Leader key */
{ CONTROL('_'), SEL_LEADER },
{ ',', SEL_LEADER },
/* Cycle contexts in forward direction */
- { '\t', SEL_CYCLE },
+ { '\t', SEL_CYCLE },
/* Cycle contexts in reverse direction */
{ KEY_BTAB, SEL_CYCLER },
/* Go to/create context N */