From 3d66db63ccb1baab2d78e6d104a9c15d3f6684d1 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Mon, 10 Feb 2025 08:57:51 +0100 Subject: grid: refactor reflow We've been trying to performance optimize reflow by "chunking" cells; try to gather as many as possible, and memcpy a chunk at once. The problem is that a) this quickly becomes very complex, and b) is very hard to get right for multi-column characters, especially when we need to truncate long ones due to the window being too small. Refactor, and once again walk and copy all cells one by one. This is slower, but at least it's correct. --- render.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'render.c') diff --git a/render.c b/render.c index 9ff9c681..3c09f7bb 100644 --- a/render.c +++ b/render.c @@ -4190,7 +4190,7 @@ delayed_reflow_of_normal_grid(struct terminal *term) /* Reflow the original (since before the resize was started) grid, * to the *current* dimensions */ grid_resize_and_reflow( - term->interactive_resizing.grid, + term->interactive_resizing.grid, term, term->interactive_resizing.new_rows, term->normal.num_cols, term->interactive_resizing.old_screen_rows, term->rows, term->selection.coords.end.row >= 0 ? ALEN(tracking_points) : 0, @@ -4409,7 +4409,7 @@ render_resize(struct terminal *term, int width, int height, uint8_t opts) } /* Don't shrink grid too much */ - const int min_cols = 7; /* See OSC-66 */ + const int min_cols = 2; const int min_rows = 1; /* Minimum window size (must be divisible by the scaling factor)*/ @@ -4691,7 +4691,7 @@ render_resize(struct terminal *term, int width, int height, uint8_t opts) }; grid_resize_and_reflow( - &term->normal, new_normal_grid_rows, new_cols, old_normal_rows, new_rows, + &term->normal, term, new_normal_grid_rows, new_cols, old_normal_rows, new_rows, term->selection.coords.end.row >= 0 ? ALEN(tracking_points) : 0, tracking_points); } -- cgit v1.3