aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-07-14 11:17:50 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-07-14 11:17:50 +0000
commit4cf7195695e2112031c630ff1102beb0f7f57e4d (patch)
tree8bed6a6837b184f6956e1622d236017cf1ac1bda /terminal.c
parentselection: foreach: don't call callback for trailing multi-character cells (diff)
selection: recognize empty padding cells in a forced linewrap
When printing a multi-column character at the end of the line, and it doesn't fit, we currently insert a forced line-wrap. This means the last character(s) on the previous line will be empty, followed by a multi-column character in the first cell on the next line. Without special code to handle this, the selection text extraction code will insert a hard newline, since this is normally the correct thing to do. Add a TODO, to consider writing a special place holder value to these padding cells.
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index 150d5335..eda311da 100644
--- a/terminal.c
+++ b/terminal.c
@@ -2399,6 +2399,16 @@ term_print(struct terminal *term, wchar_t wc, int width)
/* Multi-column character that doesn't fit on current line -
* force a line wrap */
term->grid->cursor.lcf = 1;
+
+ /*
+ * TODO: should we insert place holder values in the remaining
+ * cells? This would allow e.g. text extraction to simply
+ * skip these, instead of trying to recognize a sequence of
+ * empty cells at the end of the line followed by a
+ * multi-column character...
+ *
+ * Might also make text reflow easier, or even more correct.
+ */
}
print_linewrap(term);