commit 3f07a8ca76e32aa07cc701b853de83244ca7605b
parent 4b4355c73376e70976a9b583e99952d9b4d67d0d
Author: Arun Prakash Jana <engineerarun@gmail.com>
Date: Wed, 21 Jul 2021 11:24:46 +0530
Press TAB to insert current file name at prompt
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git 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)