aboutsummaryrefslogtreecommitdiff
path: root/terminal.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-10 20:52:14 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-10 20:54:37 +0000
commit4a169f5643a5fae6ab2df39adeb32a3222d2811c (patch)
tree7ca6382b896f558307072cba7ade2ea08a29e7cc /terminal.c
parentREADME: reflow has been implemented (diff)
vt: tag cells that were form-feed:ed, to allow correct text reflow
To handle text reflow correctly when a line has a printable character in the last column, but was still line breaked, we need to track the fact that the slave inserted a line break here. Otherwise, when the window width is increased, we'll end up pulling up the next line, when we really should have inserted a line break.
Diffstat (limited to 'terminal.c')
-rw-r--r--terminal.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/terminal.c b/terminal.c
index a07b1912..5c9f0b8b 100644
--- a/terminal.c
+++ b/terminal.c
@@ -1495,6 +1495,14 @@ term_scroll_reverse(struct terminal *term, int rows)
}
void
+term_formfeed(struct terminal *term)
+{
+ if (term->cursor.point.col > 0)
+ term->grid->cur_row->cells[term->cursor.point.col - 1].attrs.linefeed = 1;
+ term_cursor_left(term, term->cursor.point.col);
+}
+
+void
term_linefeed(struct terminal *term)
{
if (term->cursor.point.row == term->scroll_region.end - 1)