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

add line kill and discard ability

This commit is contained in:
Jfreegman
2013-12-05 22:55:14 -05:00
parent 2ad238d69f
commit 7a14845790
7 changed files with 76 additions and 14 deletions

View File

@ -296,6 +296,18 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key)
del_char_buf_frnt(ctx->line, &ctx->pos, &ctx->len);
}
else if (key == T_KEY_DISCARD) { /* CTRL-U: Delete entire line behind pos */
if (ctx->pos > 0) {
discard_buf(ctx->line, &ctx->pos, &ctx->len);
wmove(self->window, y2 - CURS_Y_OFFSET, 0);
}
}
else if (key == T_KEY_KILL) { /* CTRL-K: Delete entire line in front of pos */
if (ctx->pos != ctx->len)
kill_buf(ctx->line, &ctx->pos, &ctx->len);
}
else if (key == KEY_HOME) { /* HOME key: Move cursor to beginning of line */
if (ctx->pos > 0) {
ctx->pos = 0;