From 3f07a8ca76e32aa07cc701b853de83244ca7605b Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Wed, 21 Jul 2021 11:24:46 +0530 Subject: [PATCH] Press TAB to insert current file name at prompt --- src/nnn.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/nnn.c b/src/nnn.c index 53ccffac..d96509ab 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -3457,8 +3457,11 @@ static char *xreadline(const char *prefill, const char *prompt) memmove(buf + pos - 1, buf + pos, (len - pos) * WCHAR_T_WIDTH); --len, --pos; - } // fallthrough - case '\t': /* Tab breaks cursor position, ignore it */ + } + continue; + case '\t': + if (!(len || pos) && ndents) + len = pos = mbstowcs(buf, pdents[cur].name, READLINE_MAX); continue; case CONTROL('F'): if (pos < len) -- 2.48.1