mirror of
https://github.com/mintsuki/flanterm
synced 2024-11-27 07:09:40 +03:00
Fix some issues detected when trying to run apt
This commit is contained in:
parent
5798447df2
commit
bd351cda31
@ -724,10 +724,13 @@ static void fbterm_raw_putchar(struct term_context *_ctx, uint8_t c) {
|
||||
if (ctx->cursor_x >= _ctx->cols && (ctx->cursor_y < _ctx->scroll_bottom_margin - 1 || _ctx->scroll_enabled)) {
|
||||
ctx->cursor_x = 0;
|
||||
ctx->cursor_y++;
|
||||
}
|
||||
if (ctx->cursor_y >= _ctx->scroll_bottom_margin) {
|
||||
ctx->cursor_y = _ctx->scroll_bottom_margin - 1;
|
||||
fbterm_scroll(_ctx);
|
||||
if (ctx->cursor_y == _ctx->scroll_bottom_margin) {
|
||||
ctx->cursor_y--;
|
||||
fbterm_scroll(_ctx);
|
||||
}
|
||||
if (ctx->cursor_y >= _ctx->cols) {
|
||||
ctx->cursor_y = _ctx->cols - 1;
|
||||
}
|
||||
}
|
||||
|
||||
struct fbterm_char ch;
|
||||
|
14
term.c
14
term.c
@ -569,8 +569,12 @@ static void control_sequence_parse(struct term_context *ctx, uint8_t c) {
|
||||
break;
|
||||
case 'H':
|
||||
case 'f':
|
||||
ctx->esc_values[0] -= 1;
|
||||
ctx->esc_values[1] -= 1;
|
||||
if (ctx->esc_values[0] != 0) {
|
||||
ctx->esc_values[0]--;
|
||||
}
|
||||
if (ctx->esc_values[1] != 0) {
|
||||
ctx->esc_values[1]--;
|
||||
}
|
||||
if (ctx->esc_values[1] >= ctx->cols)
|
||||
ctx->esc_values[1] = ctx->cols - 1;
|
||||
if (ctx->esc_values[0] >= ctx->rows)
|
||||
@ -699,6 +703,12 @@ static void control_sequence_parse(struct term_context *ctx, uint8_t c) {
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
if (ctx->esc_values[0] == 0) {
|
||||
ctx->esc_values[0] = 1;
|
||||
}
|
||||
if (ctx->esc_values[1] == 0) {
|
||||
ctx->esc_values[1] = 1;
|
||||
}
|
||||
ctx->scroll_top_margin = 0;
|
||||
ctx->scroll_bottom_margin = ctx->rows;
|
||||
if (ctx->esc_values_i > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user