mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
term: print: also require width > 1 when checking if we need to force-wrap or not
While this might seem like it would slow down things, it should in fact help the compiler optimize: the "normal" code path, that prints regular ASCII characters, always call term_print() with width == 1.
This commit is contained in:
parent
b8c7dfba5c
commit
6ea9d1246f
1 changed files with 3 additions and 1 deletions
|
|
@ -2392,7 +2392,9 @@ term_print(struct terminal *term, wchar_t wc, int width)
|
|||
if (unlikely(width <= 0))
|
||||
return;
|
||||
|
||||
if (term->grid->cursor.point.col + width > term->cols) {
|
||||
if (unlikely(width > 1) &&
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue