diff --git a/src/chat.c b/src/chat.c index 930b4d7..cec4caf 100644 --- a/src/chat.c +++ b/src/chat.c @@ -396,7 +396,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key) mv_curs_end(self->window, ctx->len, y2, x2); } - else if (key == '\t') { /* TAB key: command */ + else if (key == '\t') { /* TAB key: completes command */ if (ctx->len > 1 && ctx->line[0] == '/') { int diff = complete_line(ctx->line, &ctx->pos, &ctx->len, chat_cmd_list, AC_NUM_CHAT_COMMANDS, MAX_CMDNAME_SIZE); diff --git a/src/groupchat.c b/src/groupchat.c index 20e2741..a3023bc 100644 --- a/src/groupchat.c +++ b/src/groupchat.c @@ -393,7 +393,8 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key) else if (key == '\t') { /* TAB key: completes peer name */ if (ctx->len > 0) { int diff; - if (ctx->line[0] != '/') + + if ((ctx->line[0] != '/') || (ctx->line[1] == 'm' && ctx->line[2] == 'e')) diff = complete_line(ctx->line, &ctx->pos, &ctx->len, groupchats[self->num].peer_names, groupchats[self->num].num_peers, TOX_MAX_NAME_LENGTH); else diff --git a/src/toxic_strings.c b/src/toxic_strings.c index 01a5109..5813edf 100644 --- a/src/toxic_strings.c +++ b/src/toxic_strings.c @@ -130,9 +130,8 @@ void fetch_hist_item(wchar_t *buf, size_t *pos, size_t *len, wchar_t (*hst)[MAX_ beep(); } } else { - if (++(*hst_pos) > hst_tot) { + if (++(*hst_pos) >= hst_tot) { --(*hst_pos); - beep(); return; } } diff --git a/src/toxic_windows.h b/src/toxic_windows.h index 4f8b025..9444324 100644 --- a/src/toxic_windows.h +++ b/src/toxic_windows.h @@ -111,7 +111,7 @@ struct StatusBar { bool is_online; }; -#define MAX_LINE_HIST 128 +#define MAX_LINE_HIST 10 /* chat and groupchat window/buffer holder */ struct ChatContext {