mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-09 05:33:58 -04:00
term: print: line-wrap multi-column characters instead of cutting them in half
This commit is contained in:
parent
2e7ead42de
commit
8448296bb3
2 changed files with 6 additions and 4 deletions
|
|
@ -71,7 +71,7 @@
|
||||||
* `OSC 12 ?` to return the cursor color, not the cursor's text color.
|
* `OSC 12 ?` to return the cursor color, not the cursor's text color.
|
||||||
* `OSC 12;#000000` to configure the cursor to use inverted
|
* `OSC 12;#000000` to configure the cursor to use inverted
|
||||||
foreground/background colors.
|
foreground/background colors.
|
||||||
|
* Double-width characters line wrapping at end of line.
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2284,9 +2284,11 @@ term_disable_app_sync_updates(struct terminal *term)
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
print_linewrap(struct terminal *term)
|
print_linewrap(struct terminal *term, int width)
|
||||||
{
|
{
|
||||||
if (likely(!term->grid->cursor.lcf)) {
|
if (likely(!(term->grid->cursor.lcf ||
|
||||||
|
term->grid->cursor.point.col + width > term->cols)))
|
||||||
|
{
|
||||||
/* Not and end of line */
|
/* Not and end of line */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -2329,7 +2331,7 @@ term_print(struct terminal *term, wchar_t wc, int width)
|
||||||
if (unlikely(width <= 0))
|
if (unlikely(width <= 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
print_linewrap(term);
|
print_linewrap(term, width);
|
||||||
print_insert(term, width);
|
print_insert(term, width);
|
||||||
|
|
||||||
sixel_delete_at_cursor(term);
|
sixel_delete_at_cursor(term);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue