mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-30 11:10:23 -04:00
term: print: force line-wrap if a multi-column character does not fit on current line
This commit is contained in:
parent
bc2fc778ae
commit
9dc1d18241
2 changed files with 9 additions and 0 deletions
|
|
@ -102,6 +102,9 @@
|
||||||
the cursor was **not** at the bottom of the scrolling region.
|
the cursor was **not** at the bottom of the scrolling region.
|
||||||
* `IND` and `RI` now clears `LCF`.
|
* `IND` and `RI` now clears `LCF`.
|
||||||
* `DECAWM` not clears `LCF`.
|
* `DECAWM` not clears `LCF`.
|
||||||
|
* A multi-column character that does not fit on the current line is
|
||||||
|
now printed on the next line, instead of only printing half the
|
||||||
|
character.
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
|
|
@ -2388,6 +2388,12 @@ term_print(struct terminal *term, wchar_t wc, int width)
|
||||||
if (unlikely(width <= 0))
|
if (unlikely(width <= 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (term->grid->cursor.point.col + width > term->cols) {
|
||||||
|
/* Multi-column character that doesn't fit on current line -
|
||||||
|
* force a line wrap */
|
||||||
|
term->grid->cursor.lcf = 1;
|
||||||
|
}
|
||||||
|
|
||||||
print_linewrap(term);
|
print_linewrap(term);
|
||||||
print_insert(term, width);
|
print_insert(term, width);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue