mirror of
				https://github.com/Tha14/toxic.git
				synced 2025-10-31 18:56:51 +01:00 
			
		
		
		
	fix a couple bugs
This commit is contained in:
		| @@ -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); | ||||||
|   | |||||||
| @@ -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 | ||||||
|   | |||||||
| @@ -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; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
|   | |||||||
| @@ -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 { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user