mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-02 07:15:31 -04:00
csi: cleanup
This commit is contained in:
parent
3d58d24963
commit
2f3f4ac56f
1 changed files with 3 additions and 18 deletions
21
csi.c
21
csi.c
|
|
@ -57,10 +57,6 @@ initialize_colors256(void)
|
||||||
b * 51 / 255.0,
|
b * 51 / 255.0,
|
||||||
1.0,
|
1.0,
|
||||||
};
|
};
|
||||||
#if 0
|
|
||||||
colors256[16 + r * 6 * 6 + g * 6 + b] =
|
|
||||||
(51 * r) << 24 | (51 * g) << 16 | (51 * b) << 8 | 0xff;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -72,7 +68,6 @@ initialize_colors256(void)
|
||||||
i * 11 / 255.0,
|
i * 11 / 255.0,
|
||||||
1.0
|
1.0
|
||||||
};
|
};
|
||||||
//(11 * i) << 24 | (11 * i) << 16 | (11 * i) << 8 | 0xff;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -292,11 +287,7 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
|
|
||||||
case 'd': {
|
case 'd': {
|
||||||
/* VPA - vertical line position absolute */
|
/* VPA - vertical line position absolute */
|
||||||
int row = param_get(term, 0, 1);
|
int row = min(param_get(term, 0, 1), term->rows);
|
||||||
|
|
||||||
if (row > term->rows)
|
|
||||||
row = term->rows;
|
|
||||||
|
|
||||||
term_cursor_to(term, row - 1, term->cursor.col);
|
term_cursor_to(term, row - 1, term->cursor.col);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -334,14 +325,8 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
||||||
|
|
||||||
case 'H': {
|
case 'H': {
|
||||||
/* Move cursor */
|
/* Move cursor */
|
||||||
int row = param_get(term, 0, 1);
|
int row = min(param_get(term, 0, 1), term->rows);
|
||||||
int col = param_get(term, 1, 1);
|
int col = min(param_get(term, 1, 1), term->cols);
|
||||||
|
|
||||||
if (row > term->rows)
|
|
||||||
row = term->rows;
|
|
||||||
if (col > term->cols)
|
|
||||||
col = term->cols;
|
|
||||||
|
|
||||||
term_cursor_to(term, row - 1, col - 1);
|
term_cursor_to(term, row - 1, col - 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue