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:
12
src/chat.c
12
src/chat.c
@ -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;
|
||||
|
Reference in New Issue
Block a user