From 7085174642ca97284ae7dabaf20d501f93ae88b2 Mon Sep 17 00:00:00 2001 From: Gerd Moellmann Date: Wed, 11 Aug 1999 11:50:20 +0000 Subject: [PATCH] (face_before_or_after_it_pos): If position after or before iterator's current position in the buffer is out of bounds, return the iterator's original face id. --- src/xdisp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/xdisp.c b/src/xdisp.c index 28a6299836a..ed5b22c8797 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1991,6 +1991,10 @@ face_before_or_after_it_pos (it, before_p) } else { + if ((IT_CHARPOS (*it) >= ZV && !before_p) + || (IT_CHARPOS (*it) <= BEGV && before_p)) + return it->face_id; + limit = IT_CHARPOS (*it) + TEXT_PROP_DISTANCE_LIMIT; pos = it->current.pos; @@ -1998,7 +2002,7 @@ face_before_or_after_it_pos (it, before_p) DEC_TEXT_POS (pos); else INC_TEXT_POS (pos); - + /* Determine face for CHARSET_ASCII, or unibyte. */ face_id = face_at_buffer_position (it->w, CHARPOS (pos), -- 2.39.5