aboutsummaryrefslogtreecommitdiffstats
path: root/src/nnn.c
diff options
context:
space:
mode:
authorGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-01-19 13:09:46 +0530
committerGravatar Arun Prakash Jana <engineerarun@gmail.com>2019-01-19 13:09:46 +0530
commit5f581ff20a2aac0b4ea0a4cdb0f460df721d28f5 (patch)
tree2890f459a23e54effa8e5d344ee906442fdbbfe0 /src/nnn.c
parent5e4810b382e1c4bb64893d45c28333898f787cca (diff)
downloadnnn-5f581ff20a2aac0b4ea0a4cdb0f460df721d28f5.tar.gz
Key N to switch to context N
Diffstat (limited to 'src/nnn.c')
-rw-r--r--src/nnn.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/nnn.c b/src/nnn.c
index 5062f16..7130d33 100644
--- a/src/nnn.c
+++ b/src/nnn.c
@@ -2100,7 +2100,7 @@ static bool show_help(char *path)
"e/ Filter Ins, ^T Toggle nav-as-you-type\n"
"eb Pin current dir ^W Go to pinned dir\n"
"8Tab, ^I Next context d Toggle detail view\n"
- "a`, ^/ Leader key LeaderN Go to/create context N\n"
+ "a`, ^/ Leader key N, LeadN Go to/create context N\n"
"cEsc Exit prompt ^L Redraw/clear prompt\n"
"d^G Quit and cd q Quit context\n"
"aQ, ^Q Quit ? Help, config\n"
@@ -2874,9 +2874,15 @@ nochange:
setdirwatch();
goto begin;
case SEL_LEADER: // fallthrough
- case SEL_CYCLE:
+ case SEL_CYCLE: // fallthrough
+ case SEL_CTX1: // fallthrough
+ case SEL_CTX2: // fallthrough
+ case SEL_CTX3: // fallthrough
+ case SEL_CTX4:
if (sel == SEL_CYCLE)
fd = '>';
+ else if (sel >= SEL_CTX1 && sel <= SEL_CTX4)
+ fd = sel - SEL_CTX1 + '1';
else
fd = get_input(NULL);
@@ -2887,9 +2893,9 @@ nochange:
case '&':
presel = fd;
goto nochange;
- case '>':
- case '.':
- case '<':
+ case '>': // fallthrough
+ case '.': // fallthrough
+ case '<': // fallthrough
case ',':
r = cfg.curctx;
if (fd == '>' || fd == '.')