From 2ee03dde4e0909e079c2486489986408c03a3498 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 9 Mar 2025 22:23:11 +0530 Subject: [PATCH] Fix #8421 --- kitty/line.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/line.c b/kitty/line.c index 6e17b5aef..66540a77f 100644 --- a/kitty/line.c +++ b/kitty/line.c @@ -189,7 +189,7 @@ prev_char_pos(const Line *self, index_type x, index_type num) { const CPUCell *ans = self->cpu_cells + x, *limit = self->cpu_cells - 1; if (ans->is_multicell) ans -= ans->x; while (num-- && --ans > limit) if (ans->is_multicell) ans -= ans->x; - return ans > limit ? ans - self->cpu_cells : self->xnum; + return ans > limit ? (index_type)(ans - self->cpu_cells) : self->xnum; }