; * src/xfaces.c (face_at_buffer_position): Fix next_overlay per bug#80242.

This commit is contained in:
Eli Zaretskii 2026-02-14 12:39:03 +02:00
parent 6aefaca819
commit f452b18e87

View file

@ -6928,6 +6928,10 @@ face_at_buffer_position (struct window *w, ptrdiff_t pos,
{
ptrdiff_t next_overlay;
GET_OVERLAYS_AT (pos, overlay_vec, noverlays, &next_overlay);
/* overlays_at can return next_overlay beyond the end of the current
narrowing. We don't want that to leak into the display code. */
if (next_overlay > ZV)
next_overlay = ZV;
if (next_overlay < endpos)
endpos = next_overlay;
}