/* Ctrl+T Swap the last two characters before the cursor (typo).  */
static int handle_ctrl_t(struct shell_t *self_p)
/* Ctrl+T Swap the last two characters before the cursor (typo).  */
static int handle_ctrl_t(struct shell_t *self_p)
{
    char c;
    int cursor;
    cursor = line_get_cursor(&self_p->line);
    if (cursor == 0) {
        return (-1);
    }
    if (line_get_length(&self_p->line) < 2) {
        return (-1);
    }
    if (cursor == line_get_length(&self_p->line)) {
        line_seek(&self_p->line, -1);
    }
    c = line_peek(&self_p->line);
    line_delete(&self_p->line);
    line_seek(&self_p->line, -1);
    line_insert(&self_p->line, c);
    line_seek(&self_p->line, 1);
    return (0);
}