diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-02-14 21:39:26 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-02-14 21:39:26 +0000 |
| commit | ce8005545d5bc94775f616d0caacd55e691e400f (patch) | |
| tree | fc1af48637a7304ed12f81767d6d4dfd3030ee84 /grid.c | |
| parent | render: resize: don't reflow text if grid layout hasn't changed (diff) | |
term: convert cell 'linefeed' attribute to a row 'linebreak' property
To do text reflow, we only need to know if a line has been explicitly
linebreaked or not. If not, that means it wrapped, and that we
should *not* insert a linebreak when reflowing text.
When reflowing text, when reaching the end of a row in the old grid,
only insert a linebreak in the new grid if the old row had been
explicitly linebreaked.
Furthermore, when reflowing text and wrapping a row in the new grid,
mark the previous row as linebreaked if either the last cell was
(the last column in the last row) empty, or the current cell (the
first column in the new row) is empty. If both are non-empty, then we
assume a linewrap.
Diffstat (limited to 'grid.c')
| -rw-r--r-- | grid.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -28,6 +28,7 @@ grid_row_alloc(int cols, bool initialize) { struct row *row = malloc(sizeof(*row)); row->dirty = false; + row->linebreak = false; if (initialize) { row->cells = calloc(cols, sizeof(row->cells[0])); |
