aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGerd Moellmann1999-08-11 11:50:20 +0000
committerGerd Moellmann1999-08-11 11:50:20 +0000
commit7085174642ca97284ae7dabaf20d501f93ae88b2 (patch)
treef82a1078a416026600037b7feecd83692a975f21 /src
parenta38634ff1fc7d7f62297b949a962ca64236bda4d (diff)
downloademacs-7085174642ca97284ae7dabaf20d501f93ae88b2.tar.gz
emacs-7085174642ca97284ae7dabaf20d501f93ae88b2.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c6
1 files changed, 5 insertions, 1 deletions
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)
1991 } 1991 }
1992 else 1992 else
1993 { 1993 {
1994 if ((IT_CHARPOS (*it) >= ZV && !before_p)
1995 || (IT_CHARPOS (*it) <= BEGV && before_p))
1996 return it->face_id;
1997
1994 limit = IT_CHARPOS (*it) + TEXT_PROP_DISTANCE_LIMIT; 1998 limit = IT_CHARPOS (*it) + TEXT_PROP_DISTANCE_LIMIT;
1995 pos = it->current.pos; 1999 pos = it->current.pos;
1996 2000
@@ -1998,7 +2002,7 @@ face_before_or_after_it_pos (it, before_p)
1998 DEC_TEXT_POS (pos); 2002 DEC_TEXT_POS (pos);
1999 else 2003 else
2000 INC_TEXT_POS (pos); 2004 INC_TEXT_POS (pos);
2001 2005
2002 /* Determine face for CHARSET_ASCII, or unibyte. */ 2006 /* Determine face for CHARSET_ASCII, or unibyte. */
2003 face_id = face_at_buffer_position (it->w, 2007 face_id = face_at_buffer_position (it->w,
2004 CHARPOS (pos), 2008 CHARPOS (pos),