From dd5b419742b94ff68c10c7c3c1836968daf3b175 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sat, 22 Feb 2020 21:20:20 +0530 Subject: [PATCH] Treat ~ as special shortcut in filterentries --- nnn.1 | 2 ++ src/nnn.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/nnn.1 b/nnn.1 index 363410b..e02ee69 100644 --- a/nnn.1 +++ b/nnn.1 @@ -189,6 +189,8 @@ Special keys at empty filter prompt: - run a plugin by its key: ';' .br - pin current directory: ',' +.br +- go HOME: '~' .Pp Other noteworthy keys: .Pp diff --git a/src/nnn.c b/src/nnn.c index ae7a906..4be2a78 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -2499,9 +2499,10 @@ static int filterentries(char *path, char *lastname) if (len == 1) { switch (*ch) { case '=': // fallthrough /* Launch app */ - case ']': // fallthorugh /*Prompt key */ + case ']': // fallthorugh /* Prompt key */ case ';': // fallthrough /* Run plugin key */ case ',': // fallthrough /* Pin CWD */ + case '~': // fallthrough /* Go HOME */ case '?': /* Help and config key, '?' is an invalid regex */ goto end; }