aboutsummaryrefslogtreecommitdiff
path: root/render.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-08-31 07:23:05 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-08-31 07:23:05 +0000
commitcc02902db0627dfbb5c290a35c1c0480a916d2bb (patch)
tree93e2429a0d9d7c20a896e931eef80624954af2c5 /render.c
parentcsi: multi-cursor: allocate grid->num_rows rows (diff)
render: multi-cursor: translate view-based row number to absolute
Otherwise we'll lookup the wrong multi-cursor shape.
Diffstat (limited to 'render.c')
-rw-r--r--render.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/render.c b/render.c
index b86f1c5f..5af3d44b 100644
--- a/render.c
+++ b/render.c
@@ -1348,8 +1348,14 @@ render_row(struct terminal *term, pixman_image_t *pix,
cursor_col == col, MULTI_CURSOR_SHAPE_NONE);
}
} else {
+ /* Translate view-relative row number to absolute numbers */
+ int multi_cursor_row = row_no;
+ multi_cursor_row += term->grid->view;
+ multi_cursor_row -= term->grid->offset;
+ multi_cursor_row &= term->grid->num_rows - 1;
+
enum multi_cursor_shape *extra_cursors =
- &term->multi_cursor.shapes[row_no * term->cols + term->cols - 1];
+ &term->multi_cursor.shapes[multi_cursor_row * term->cols + term->cols - 1];
for (int col = term->cols - 1; col >= 0; col--, extra_cursors--) {
render_cell(term, pix, damage, row, row_no, col,