From f86b1be5a68eaabae6e5aa62ad8ae3d28085ddb5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 27 Jun 2024 15:36:28 -0400 Subject: [PATCH] (buf_bytepos_to_charpos): Fix mixup introduced in commit b300052fb4ef * src/marker.c (buf_bytepos_to_charpos): Don't compare byte-positions with char-positions. (cherry picked from commit b595b4598e7b3dabe4d45895f5580c9a351f2885) --- src/marker.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/marker.c b/src/marker.c index f016bf9c088..9aaa2e7402c 100644 --- a/src/marker.c +++ b/src/marker.c @@ -358,11 +358,11 @@ buf_bytepos_to_charpos (struct buffer *b, ptrdiff_t bytepos) { CONSIDER (tail->bytepos, tail->charpos); - /* If we are down to a range of 50 chars, + /* If we are down to a range of DISTANCE bytes, don't bother checking any other markers; scan the intervening chars directly now. */ - if (best_above - bytepos < distance - || bytepos - best_below < distance) + if (best_above_byte - bytepos < distance + || bytepos - best_below_byte < distance) break; else distance += BYTECHAR_DISTANCE_INCREMENT; -- 2.39.2