aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-14 08:58:57 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-14 08:58:57 +0000
commit9dc1d18241be1c496980b30c2b3eb943dd9aaccb (patch)
tree7f29025fdfb3a9fb1f5ab8b4ba8a4814d2c3fc1a
parentcsi: DECAWM: clear LCF (diff)
term: print: force line-wrap if a multi-column character does not fit on current line
-rw-r--r--CHANGELOG.md3
-rw-r--r--terminal.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 01df8b1e..d0abae72 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -102,6 +102,9 @@
the cursor was **not** at the bottom of the scrolling region.
* `IND` and `RI` now 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
diff --git a/terminal.c b/terminal.c
index 78f64510..76318d90 100644
--- a/terminal.c
+++ b/terminal.c
@@ -2388,6 +2388,12 @@ term_print(struct terminal *term, wchar_t wc, int width)
if (unlikely(width <= 0))
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_insert(term, width);