Revert "grid: invert the default value of ‘linebreak’, from false to true"

This reverts commit cdd46cdf85.
This commit is contained in:
Daniel Eklöf 2022-06-30 19:37:01 +02:00
parent d58290ea12
commit 37f094280b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 6 additions and 12 deletions

14
grid.c
View file

@ -318,7 +318,7 @@ grid_row_alloc(int cols, bool initialize)
{ {
struct row *row = xmalloc(sizeof(*row)); struct row *row = xmalloc(sizeof(*row));
row->dirty = false; row->dirty = false;
row->linebreak = true; row->linebreak = false;
row->extra = NULL; row->extra = NULL;
row->prompt_marker = false; row->prompt_marker = false;
@ -538,7 +538,7 @@ _line_wrap(struct grid *old_grid, struct row **new_grid, struct row *row,
} else { } else {
/* Scrollback is full, need to re-use a row */ /* Scrollback is full, need to re-use a row */
grid_row_reset_extra(new_row); grid_row_reset_extra(new_row);
new_row->linebreak = true; new_row->linebreak = false;
new_row->prompt_marker = false; new_row->prompt_marker = false;
tll_foreach(old_grid->sixel_images, it) { tll_foreach(old_grid->sixel_images, it) {
@ -878,14 +878,6 @@ grid_resize_and_reflow(
&new_row->cells[new_col_idx], &old_row->cells[from], &new_row->cells[new_col_idx], &old_row->cells[from],
amount * sizeof(struct cell)); amount * sizeof(struct cell));
/*
* Weve printed to this line - reset linebreak.
*
* If the old line ends with a hard linebreak, well
* set linebreak=true on the last new row we print to.
*/
new_row->linebreak = false;
count -= amount; count -= amount;
from += amount; from += amount;
new_col_idx += amount; new_col_idx += amount;
@ -944,7 +936,7 @@ grid_resize_and_reflow(
} }
if (old_row->linebreak && col_count > 0) { if (old_row->linebreak) {
/* Erase the remaining cells */ /* Erase the remaining cells */
memset(&new_row->cells[new_col_idx], 0, memset(&new_row->cells[new_col_idx], 0,
(new_cols - new_col_idx) * sizeof(new_row->cells[0])); (new_cols - new_col_idx) * sizeof(new_row->cells[0]));

View file

@ -1811,7 +1811,7 @@ static inline void
erase_line(struct terminal *term, struct row *row) erase_line(struct terminal *term, struct row *row)
{ {
erase_cell_range(term, row, 0, term->cols - 1); erase_cell_range(term, row, 0, term->cols - 1);
row->linebreak = true; row->linebreak = false;
row->prompt_marker = false; row->prompt_marker = false;
} }
@ -3298,6 +3298,7 @@ term_print(struct terminal *term, char32_t wc, int width)
/* *Must* get current cell *after* linewrap+insert */ /* *Must* get current cell *after* linewrap+insert */
struct row *row = grid->cur_row; struct row *row = grid->cur_row;
row->dirty = true; row->dirty = true;
row->linebreak = true;
struct cell *cell = &row->cells[col]; struct cell *cell = &row->cells[col];
cell->wc = term->vt.last_printed = wc; cell->wc = term->vt.last_printed = wc;
@ -3357,6 +3358,7 @@ ascii_printer_fast(struct terminal *term, char32_t wc)
struct row *row = grid->cur_row; struct row *row = grid->cur_row;
row->dirty = true; row->dirty = true;
row->linebreak = true;
struct cell *cell = &row->cells[col]; struct cell *cell = &row->cells[col];
cell->wc = term->vt.last_printed = wc; cell->wc = term->vt.last_printed = wc;