aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2022-11-06 11:33:38 +0200
committerEli Zaretskii2022-11-06 11:33:38 +0200
commit24e5abdc069874732bcd6771bf2298eddf553d7c (patch)
tree21c2d41dcec0a6ad402d988ab249486cede670bb
parent6a132f9b52fd5e53298264ec89652be1a130a472 (diff)
downloademacs-24e5abdc069874732bcd6771bf2298eddf553d7c.tar.gz
emacs-24e5abdc069874732bcd6771bf2298eddf553d7c.zip
Fix face extension when Org narrows the buffer
* src/xdisp.c (extend_face_to_end_of_line): Make sure glyph rows at ZV use the default face for extension. (Bug#59065)
-rw-r--r--src/xdisp.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index dd243eca986..054adb9d9d9 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -23153,10 +23153,15 @@ extend_face_to_end_of_line (struct it *it)
23153 this is called when redisplaying a non-selected window, with 23153 this is called when redisplaying a non-selected window, with
23154 point temporarily moved to window-point. */ 23154 point temporarily moved to window-point. */
23155 specbind (Qinhibit_quit, Qt); 23155 specbind (Qinhibit_quit, Qt);
23156 const int extend_face_id = (it->face_id == DEFAULT_FACE_ID 23156 /* The default face, possibly remapped. */
23157 || it->s != NULL) 23157 struct face *default_face =
23158 ? DEFAULT_FACE_ID 23158 FACE_FROM_ID_OR_NULL (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID));
23159 : face_at_pos (it, LFACE_EXTEND_INDEX); 23159 const int extend_face_id =
23160 (it->face_id == default_face->id || it->s != NULL)
23161 ? it->face_id
23162 : (it->glyph_row->ends_at_zv_p
23163 ? default_face->id
23164 : face_at_pos (it, LFACE_EXTEND_INDEX));
23160 unbind_to (count, Qnil); 23165 unbind_to (count, Qnil);
23161 23166
23162 /* Face extension extends the background and box of IT->extend_face_id 23167 /* Face extension extends the background and box of IT->extend_face_id
@@ -23193,14 +23198,8 @@ extend_face_to_end_of_line (struct it *it)
23193 if (!ASCII_CHAR_P (it->c)) 23198 if (!ASCII_CHAR_P (it->c))
23194 it->face_id = FACE_FOR_CHAR (f, face, 0, -1, Qnil); 23199 it->face_id = FACE_FOR_CHAR (f, face, 0, -1, Qnil);
23195 23200
23196 /* The default face, possibly remapped. */
23197 struct face *default_face =
23198 FACE_FROM_ID (f, lookup_basic_face (it->w, f, DEFAULT_FACE_ID));
23199 23201
23200#ifdef HAVE_WINDOW_SYSTEM 23202#ifdef HAVE_WINDOW_SYSTEM
23201 if (default_face == NULL)
23202 error ("extend_face_to_end_of_line: default_face is not set!");
23203
23204 if (FRAME_WINDOW_P (f)) 23203 if (FRAME_WINDOW_P (f))
23205 { 23204 {
23206 /* If the row is empty, add a space with the current face of IT, 23205 /* If the row is empty, add a space with the current face of IT,