vte: remove kmscon_console_backspace()

This function is not needed at all. Instead, we should simply move one
character to the left on incoming backspace. There is no need to handle
auto-wrap on backspace.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-05-28 16:49:56 +02:00
parent cd553c54ad
commit 6b4fc364df
3 changed files with 1 additions and 21 deletions

View File

@ -1086,21 +1086,6 @@ void kmscon_console_newline(struct kmscon_console *con)
}
}
void kmscon_console_backspace(struct kmscon_console *con)
{
if (!con)
return;
if (con->cursor_x >= con->cells->size_x) {
con->cursor_x = con->cells->size_x - 2;
} else if (con->cursor_x > 0) {
con->cursor_x--;
} else if (con->auto_wrap) {
con->cursor_x = con->cells->size_x - 1;
kmscon_console_move_up(con, 1, true);
}
}
void kmscon_console_move_to(struct kmscon_console *con, unsigned int x,
unsigned int y)
{

View File

@ -58,7 +58,6 @@ void kmscon_console_draw(struct kmscon_console *con, struct font_screen *fscr);
void kmscon_console_write(struct kmscon_console *con, kmscon_symbol_t ch,
const struct font_char_attr *attr);
void kmscon_console_newline(struct kmscon_console *con);
void kmscon_console_backspace(struct kmscon_console *con);
void kmscon_console_move_to(struct kmscon_console *con, unsigned int x,
unsigned int y);
void kmscon_console_move_up(struct kmscon_console *con, unsigned int num,

View File

@ -217,11 +217,7 @@ static void do_execute(struct kmscon_vte *vte, uint32_t ctrl)
break;
case 0x08: /* BS */
/* Move cursor one position left */
/* TODO: Do we really have auto-wrap feature here? vt520
* doc says nothing about it. We should probably use
* kmscon_console_move_left() here.
*/
kmscon_console_backspace(vte->con);
kmscon_console_move_left(vte->con, 1);
break;
case 0x09: /* HT */
/* Move to next tab stop or end of line */