aboutsummaryrefslogtreecommitdiff
path: root/grid.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-05-25 17:31:38 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-02 18:13:51 +0000
commita56b54ad2f3cc0f5d43a1f32227d4f3867c07867 (patch)
treeddd1dc568f8f65734c165ff610c2fa155d33591b /grid.c
parentgrid: reflow: slightly simplified logic for end-coordinate calculation (diff)
grid: set tp/uri break flags explicitly when we know them to be true
Diffstat (limited to 'grid.c')
-rw-r--r--grid.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/grid.c b/grid.c
index d318c541..4f1223dc 100644
--- a/grid.c
+++ b/grid.c
@@ -549,26 +549,32 @@ grid_resize_and_reflow(
int uri_col = -1;
int end;
+ bool tp_break = false;
+ bool uri_break = false;
+
if (range != NULL) {
uri_col = (range->start >= start ? range->start : range->end) + 1;
if (tp != NULL) {
tp_col = tp->col + 1;
end = min(tp_col, uri_col);
- } else
+
+ tp_break = end == tp_col;
+ uri_break = end == uri_col;
+ } else {
end = uri_col;
- } else if (tp != NULL)
+ uri_break = true;
+ }
+ } else if (tp != NULL) {
end = tp_col = tp->col + 1;
- else
+ tp_break = true;
+ } else
end = col_count;
int cols = end - start;
xassert(cols > 0);
xassert(start + cols <= old_cols);
- bool tp_break = tp_col == end;
- bool uri_break = uri_col == end;
-
for (int count = cols, from = start; count > 0;) {
xassert(new_col_idx <= new_cols);
int new_row_cells_left = new_cols - new_col_idx;