From 43134cdfa88f1092c18dea3095adac7a5944cf7a Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sat, 3 Mar 2018 19:19:06 +0530 Subject: Support ~, - and & keyboard shortcuts at the bookmark prompt. In nav-as-you-type mode only control keys are understood when filter is enabled. We need some way to quicly jump HOME, last visited dir or start dir. --- nnn.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'nnn.c') diff --git a/nnn.c b/nnn.c index 291c119..3f186eb 100644 --- a/nnn.c +++ b/nnn.c @@ -2726,9 +2726,15 @@ nochange: printprompt("key: "); tmp = readinput(); clearprompt(); - if (tmp == NULL) + if (tmp == NULL || tmp[0] == '\0') break; + /* Interpret ~, - and & keys */ + if ((tmp[1] == '\0') && (tmp[0] == '~' || tmp[0] == '-' || tmp[0] == '&')) { + presel = tmp[0]; + goto begin; + } + if (get_bm_loc(tmp, newpath) == NULL) { printmsg(messages[STR_INVBM_ID]); goto nochange; -- cgit v1.2.3-70-g09d2