mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-16 22:05:21 -05:00
term: formfeed: set linefeed correctly when we're at last column with lcf=1
When cursor.lcf is set, that means the cursor column was *not* incremented when we printed the last character. Thus, we should *not* decrement the column before setting the linefeed bit.
This commit is contained in:
parent
bcd28bcd14
commit
69a633221f
1 changed files with 5 additions and 2 deletions
|
|
@ -1498,8 +1498,11 @@ 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;
|
||||
int col = term->cursor.point.col;
|
||||
if (!term->cursor.lcf)
|
||||
col--;
|
||||
if (col >= 0)
|
||||
term->grid->cur_row->cells[col].attrs.linefeed = 1;
|
||||
term_cursor_left(term, term->cursor.point.col);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue