From: Arun Prakash Jana Date: Wed, 21 Jul 2021 05:54:46 +0000 (+0530) Subject: Press TAB to insert current file name at prompt X-Git-Tag: v4.2~2 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=3f07a8ca76e32aa07cc701b853de83244ca7605b;p=nnn.git Press TAB to insert current file name at prompt --- 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)