mirror of
https://github.com/Tha14/toxic.git
synced 2025-06-28 19:56:46 +02:00
Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
0013dae552 | |||
b018aa384e | |||
ad8f99dae4 | |||
5b9d3f6f62 | |||
93bcecde70 |
10
src/chat.c
10
src/chat.c
@ -312,6 +312,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
|
||||
getyx(self->window, y, x);
|
||||
getmaxyx(self->window, y2, x2);
|
||||
int cur_len = 0;
|
||||
bool close_win = false;
|
||||
|
||||
if (key == 0x107 || key == 0x8 || key == 0x7f) { /* BACKSPACE key: Remove character behind pos */
|
||||
if (ctx->pos > 0) {
|
||||
@ -440,7 +441,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
|
||||
wmove(self->window, y, x + MAX(1, wcwidth(key)));
|
||||
}
|
||||
|
||||
if (!ctx->self_is_typing)
|
||||
if (!ctx->self_is_typing && ctx->line[0] != '/')
|
||||
set_typingstatus(self, m, true);
|
||||
}
|
||||
/* RETURN key: Execute command or print line */
|
||||
@ -453,7 +454,6 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
|
||||
wclear(ctx->linewin);
|
||||
wmove(self->window, y2 - CURS_Y_OFFSET, 0);
|
||||
wclrtobot(self->window);
|
||||
bool close_win = false;
|
||||
|
||||
if (!string_is_empty(line))
|
||||
add_line_to_hist(ctx->line, ctx->len, ctx->ln_history, &ctx->hst_tot, &ctx->hst_pos);
|
||||
@ -500,8 +500,10 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
|
||||
}
|
||||
}
|
||||
|
||||
if (ctx->len <= 0 && ctx->self_is_typing)
|
||||
set_typingstatus(self, m, false);
|
||||
if (!close_win) {
|
||||
if (ctx->len <= 0 && ctx->self_is_typing)
|
||||
set_typingstatus(self, m, false);
|
||||
}
|
||||
}
|
||||
|
||||
static void chat_onDraw(ToxWindow *self, Tox *m)
|
||||
|
Reference in New Issue
Block a user