1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-23 06:03:04 +01:00

fix a couple bugs

This commit is contained in:
Jfreegman 2013-12-18 20:18:02 -05:00
parent d04f5fa102
commit feefecb2ac
4 changed files with 5 additions and 5 deletions

View File

@ -396,7 +396,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
mv_curs_end(self->window, ctx->len, y2, x2); 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] == '/') { if (ctx->len > 1 && ctx->line[0] == '/') {
int diff = complete_line(ctx->line, &ctx->pos, &ctx->len, chat_cmd_list, AC_NUM_CHAT_COMMANDS, int diff = complete_line(ctx->line, &ctx->pos, &ctx->len, chat_cmd_list, AC_NUM_CHAT_COMMANDS,
MAX_CMDNAME_SIZE); MAX_CMDNAME_SIZE);

View File

@ -393,7 +393,8 @@ static void groupchat_onKey(ToxWindow *self, Tox *m, wint_t key)
else if (key == '\t') { /* TAB key: completes peer name */ else if (key == '\t') { /* TAB key: completes peer name */
if (ctx->len > 0) { if (ctx->len > 0) {
int diff; 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, diff = complete_line(ctx->line, &ctx->pos, &ctx->len, groupchats[self->num].peer_names,
groupchats[self->num].num_peers, TOX_MAX_NAME_LENGTH); groupchats[self->num].num_peers, TOX_MAX_NAME_LENGTH);
else else

View File

@ -130,9 +130,8 @@ void fetch_hist_item(wchar_t *buf, size_t *pos, size_t *len, wchar_t (*hst)[MAX_
beep(); beep();
} }
} else { } else {
if (++(*hst_pos) > hst_tot) { if (++(*hst_pos) >= hst_tot) {
--(*hst_pos); --(*hst_pos);
beep();
return; return;
} }
} }

View File

@ -111,7 +111,7 @@ struct StatusBar {
bool is_online; bool is_online;
}; };
#define MAX_LINE_HIST 128 #define MAX_LINE_HIST 10
/* chat and groupchat window/buffer holder */ /* chat and groupchat window/buffer holder */
struct ChatContext { struct ChatContext {