1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 16:16:46 +02:00

a few fixes and update version

This commit is contained in:
Jfreegman
2013-12-04 16:21:32 -05:00
parent 1517cbb6cb
commit e3400e095b
4 changed files with 29 additions and 20 deletions

View File

@ -294,19 +294,23 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
else if (key == KEY_DC) { /* DEL key: Remove character at pos */
if (ctx->pos != ctx->len)
del_char_buf_frnt(ctx->line, &ctx->pos, &ctx->len);
}
}
else if (key == KEY_HOME) { /* HOME key: Move cursor to beginning of line */
ctx->pos = 0;
wmove(self->window, y2 - CURS_Y_OFFSET, 0);
if (ctx->pos > 0) {
ctx->pos = 0;
wmove(self->window, y2 - CURS_Y_OFFSET, 0);
}
}
else if (key == KEY_END) { /* END key: move cursor to end of line */
ctx->pos = ctx->len;
int end_y = (ctx->len / x2) + (y2 - CURS_Y_OFFSET);
int end_x = ctx->len % x2;
wmove(self->window, end_y, end_x);
}
if (ctx->pos != ctx->len) {
ctx->pos = ctx->len;
int end_y = (ctx->len / x2) + (y2 - CURS_Y_OFFSET);
int end_x = ctx->len % x2;
wmove(self->window, end_y, end_x);
}
}
else if (key == KEY_LEFT) {
if (ctx->pos > 0) {