aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2021-12-30 13:21:01 +0200
committerEli Zaretskii2021-12-30 13:21:01 +0200
commitc80d2f3d67d9802f39288945758f6bb7b88fd259 (patch)
tree85684910c1b7ede17481dbd065aac518c088038d /src
parentd1c7ce68ba91129124b4869b15df97c63fa3d4cb (diff)
downloademacs-c80d2f3d67d9802f39288945758f6bb7b88fd259.tar.gz
emacs-c80d2f3d67d9802f39288945758f6bb7b88fd259.zip
Fix start-of-box-face display after display and overlay strings
* src/xdisp.c (pop_it): Recompute the 'start_of_box_run_p' flag, like we do in 'handle_fontified_prop', when faces change while iterating over a buffer or string. (Bug#51550)
Diffstat (limited to 'src')
-rw-r--r--src/xdisp.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index a6c122aee8b..6c63278f528 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -6841,6 +6841,7 @@ pop_it (struct it *it)
6841 struct iterator_stack_entry *p; 6841 struct iterator_stack_entry *p;
6842 bool from_display_prop = it->from_disp_prop_p; 6842 bool from_display_prop = it->from_disp_prop_p;
6843 ptrdiff_t prev_pos = IT_CHARPOS (*it); 6843 ptrdiff_t prev_pos = IT_CHARPOS (*it);
6844 int prev_face_id = it->face_id;
6844 6845
6845 eassert (it->sp > 0); 6846 eassert (it->sp > 0);
6846 --it->sp; 6847 --it->sp;
@@ -6876,9 +6877,18 @@ pop_it (struct it *it)
6876 6877
6877 /* Restore the face_box_p flag, since it could have been 6878 /* Restore the face_box_p flag, since it could have been
6878 overwritten by the face of the object that we just finished 6879 overwritten by the face of the object that we just finished
6879 displaying. */ 6880 displaying. Also, set the start_of_box_run_p flag if the
6881 change in faces requires that. */
6880 if (face) 6882 if (face)
6881 it->face_box_p = face->box != FACE_NO_BOX; 6883 {
6884 struct face *prev_face = FACE_FROM_ID_OR_NULL (it->f, prev_face_id);
6885
6886 if (!(it->start_of_box_run_p && prev_face && prev_face->box))
6887 it->start_of_box_run_p = (face->box != FACE_NO_BOX
6888 && (prev_face == NULL
6889 || prev_face->box == FACE_NO_BOX));
6890 it->face_box_p = face->box != FACE_NO_BOX;
6891 }
6882 it->object = it->w->contents; 6892 it->object = it->w->contents;
6883 } 6893 }
6884 break; 6894 break;
@@ -6888,9 +6898,18 @@ pop_it (struct it *it)
6888 6898
6889 /* Restore the face_box_p flag, since it could have been 6899 /* Restore the face_box_p flag, since it could have been
6890 overwritten by the face of the object that we just finished 6900 overwritten by the face of the object that we just finished
6891 displaying. */ 6901 displaying. Also, set the start_of_box_run_p flag if the
6902 change in faces requires that. */
6892 if (face) 6903 if (face)
6893 it->face_box_p = face->box != FACE_NO_BOX; 6904 {
6905 struct face *prev_face = FACE_FROM_ID_OR_NULL (it->f, prev_face_id);
6906
6907 if (!(it->start_of_box_run_p && prev_face && prev_face->box))
6908 it->start_of_box_run_p = (face->box != FACE_NO_BOX
6909 && (prev_face == NULL
6910 || prev_face->box == FACE_NO_BOX));
6911 it->face_box_p = face->box != FACE_NO_BOX;
6912 }
6894 it->object = it->string; 6913 it->object = it->string;
6895 } 6914 }
6896 break; 6915 break;