mirror of
https://github.com/Tha14/toxic.git
synced 2025-07-03 03:16:46 +02:00
print multiple matches for all tab-complete operations, fix bug when tab-completing at end of line
This commit is contained in:
@ -177,14 +177,12 @@ static void prompt_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr)
|
||||
|
||||
if (key == '\t') { /* TAB key: auto-completes command */
|
||||
if (ctx->len > 1 && ctx->line[0] == '/') {
|
||||
int diff = complete_line(ctx, glob_cmd_list, AC_NUM_GLOB_COMMANDS, MAX_CMDNAME_SIZE);
|
||||
int diff = complete_line(self, glob_cmd_list, AC_NUM_GLOB_COMMANDS, MAX_CMDNAME_SIZE);
|
||||
|
||||
if (diff != -1) {
|
||||
if (x + diff > x2 - 1) {
|
||||
wmove(self->window, y, x + diff);
|
||||
ctx->start += diff;
|
||||
} else {
|
||||
wmove(self->window, y, x + diff);
|
||||
int wlen = wcswidth(ctx->line, sizeof(ctx->line));
|
||||
ctx->start = wlen < x2 ? 0 : wlen - x2 + 1;
|
||||
}
|
||||
} else {
|
||||
beep();
|
||||
|
Reference in New Issue
Block a user