mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Remove redundant key for first file
This commit is contained in:
parent
a86150f71a
commit
dfd1422997
|
@ -213,7 +213,7 @@ The list below is from the **dev branch**. Press <kbd>?</kbd> in `nnn` to see th
|
||||||
, ^/ Lead key N LeadN Context N
|
, ^/ Lead key N LeadN Context N
|
||||||
/ Filter/Lead Ins ^N Nav-as-you-type toggle
|
/ Filter/Lead Ins ^N Nav-as-you-type toggle
|
||||||
Esc Exit prompt ^L F5 Redraw/clear prompt
|
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
|
Q ^Q Quit ^G QuitCD q Quit context
|
||||||
FILES
|
FILES
|
||||||
^O Open with... n Create new/link
|
^O Open with... n Create new/link
|
||||||
|
@ -257,7 +257,6 @@ The Lead/Leader key provides a powerful multi-functional navigation mechanism. I
|
||||||
|:---:| --- |
|
|:---:| --- |
|
||||||
| <kbd>1-4</kbd> | Go to/create selected context |
|
| <kbd>1-4</kbd> | Go to/create selected context |
|
||||||
| key | Go to bookmarked location |
|
| key | Go to bookmarked location |
|
||||||
| <kbd>'</kbd> | Go to first file in directory |
|
|
||||||
| <kbd>~</kbd> <kbd>`</kbd> <kbd>@</kbd> <kbd>-</kbd> | Visit HOME, `/`, start, last visited dir |
|
| <kbd>~</kbd> <kbd>`</kbd> <kbd>@</kbd> <kbd>-</kbd> | Visit HOME, `/`, start, last visited dir |
|
||||||
| <kbd>.</kbd> | Toggle show hidden files |
|
| <kbd>.</kbd> | Toggle show hidden files |
|
||||||
|
|
||||||
|
|
33
src/nnn.c
33
src/nnn.c
|
@ -3491,7 +3491,7 @@ static void show_help(const char *path)
|
||||||
"9, ^/ Lead key N LeadN Context N\n"
|
"9, ^/ Lead key N LeadN Context N\n"
|
||||||
"c/ Filter/Lead Ins ^N Nav-as-you-type toggle\n"
|
"c/ Filter/Lead Ins ^N Nav-as-you-type toggle\n"
|
||||||
"aEsc Exit prompt ^L F5 Redraw/clear prompt\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"
|
"9Q ^Q Quit ^G QuitCD q Quit context\n"
|
||||||
"1FILES\n"
|
"1FILES\n"
|
||||||
"b^O Open with... n Create new/link\n"
|
"b^O Open with... n Create new/link\n"
|
||||||
|
@ -4008,9 +4008,21 @@ static inline void handle_screen_move(enum action sel)
|
||||||
case SEL_HOME:
|
case SEL_HOME:
|
||||||
move_cursor(0, 1);
|
move_cursor(0, 1);
|
||||||
break;
|
break;
|
||||||
default: /* case SEL_END: */
|
case SEL_END:
|
||||||
move_cursor(ndents - 1, 1);
|
move_cursor(ndents - 1, 1);
|
||||||
break;
|
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 @@ nochange:
|
||||||
case SEL_PGUP: // fallthrough
|
case SEL_PGUP: // fallthrough
|
||||||
case SEL_CTRL_U: // fallthrough
|
case SEL_CTRL_U: // fallthrough
|
||||||
case SEL_HOME: // fallthrough
|
case SEL_HOME: // fallthrough
|
||||||
case SEL_END:
|
case SEL_END: // fallthrough
|
||||||
|
case SEL_FIRST:
|
||||||
handle_screen_move(sel);
|
handle_screen_move(sel);
|
||||||
break;
|
break;
|
||||||
case SEL_CDHOME: // fallthrough
|
case SEL_CDHOME: // fallthrough
|
||||||
|
@ -4548,7 +4561,6 @@ nochange:
|
||||||
case SEL_LEADER: // fallthrough
|
case SEL_LEADER: // fallthrough
|
||||||
case SEL_CYCLE: // fallthrough
|
case SEL_CYCLE: // fallthrough
|
||||||
case SEL_CYCLER: // fallthrough
|
case SEL_CYCLER: // fallthrough
|
||||||
case SEL_FIRST: // fallthrough
|
|
||||||
case SEL_CTX1: // fallthrough
|
case SEL_CTX1: // fallthrough
|
||||||
case SEL_CTX2: // fallthrough
|
case SEL_CTX2: // fallthrough
|
||||||
case SEL_CTX3: // fallthrough
|
case SEL_CTX3: // fallthrough
|
||||||
|
@ -4560,9 +4572,6 @@ nochange:
|
||||||
case SEL_CYCLER:
|
case SEL_CYCLER:
|
||||||
fd = KEY_BTAB;
|
fd = KEY_BTAB;
|
||||||
break;
|
break;
|
||||||
case SEL_FIRST:
|
|
||||||
fd = '\'';
|
|
||||||
break;
|
|
||||||
case SEL_CTX1: // fallthrough
|
case SEL_CTX1: // fallthrough
|
||||||
case SEL_CTX2: // fallthrough
|
case SEL_CTX2: // fallthrough
|
||||||
case SEL_CTX3: // fallthrough
|
case SEL_CTX3: // fallthrough
|
||||||
|
@ -4580,16 +4589,6 @@ nochange:
|
||||||
case '@':
|
case '@':
|
||||||
presel = fd;
|
presel = fd;
|
||||||
goto nochange;
|
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 '.':
|
case '.':
|
||||||
cfg.showhidden ^= 1;
|
cfg.showhidden ^= 1;
|
||||||
setdirwatch();
|
setdirwatch();
|
||||||
|
|
|
@ -161,7 +161,7 @@ static struct key bindings[] = {
|
||||||
{ CONTROL('_'), SEL_LEADER },
|
{ CONTROL('_'), SEL_LEADER },
|
||||||
{ ',', SEL_LEADER },
|
{ ',', SEL_LEADER },
|
||||||
/* Cycle contexts in forward direction */
|
/* Cycle contexts in forward direction */
|
||||||
{ '\t', SEL_CYCLE },
|
{ '\t', SEL_CYCLE },
|
||||||
/* Cycle contexts in reverse direction */
|
/* Cycle contexts in reverse direction */
|
||||||
{ KEY_BTAB, SEL_CYCLER },
|
{ KEY_BTAB, SEL_CYCLER },
|
||||||
/* Go to/create context N */
|
/* Go to/create context N */
|
||||||
|
|
Loading…
Reference in a new issue