mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-23 05:33:57 -04:00
terminal: regression: char printed to wrong column
When term_print() was implemented, it introduced a regression where printing a character when the last cursor was in the last column on a line would print the character in the wrong column. This is because term_print() retrieved a pointer to the current cell *before* line wrapping (and possibly inserting empty cells).
This commit is contained in:
parent
d6ea676ef2
commit
08eb0532ad
1 changed files with 4 additions and 3 deletions
|
|
@ -1894,12 +1894,13 @@ term_print(struct terminal *term, wchar_t wc, int width)
|
||||||
if (unlikely(width <= 0))
|
if (unlikely(width <= 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
struct row *row = term->grid->cur_row;
|
|
||||||
struct cell *cell = &row->cells[term->cursor.point.col];
|
|
||||||
|
|
||||||
print_linewrap(term);
|
print_linewrap(term);
|
||||||
print_insert(term, width);
|
print_insert(term, width);
|
||||||
|
|
||||||
|
/* *Must* get current cell *after* linewrap+insert */
|
||||||
|
struct row *row = term->grid->cur_row;
|
||||||
|
struct cell *cell = &row->cells[term->cursor.point.col];
|
||||||
|
|
||||||
cell->wc = term->vt.last_printed = wc;
|
cell->wc = term->vt.last_printed = wc;
|
||||||
cell->attrs = term->vt.attrs;
|
cell->attrs = term->vt.attrs;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue