Press TAB to insert current file name at prompt

This commit is contained in:
Arun Prakash Jana 2021-07-21 11:24:46 +05:30
parent 4b4355c733
commit 3f07a8ca76
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 5 additions and 2 deletions

View File

@ -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)