diff options
| author | Eli Zaretskii | 2021-12-30 13:32:14 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2021-12-30 13:32:14 +0200 |
| commit | 8b90d91f2160c04a4f1efb0a5c05dd7c38ef0110 (patch) | |
| tree | 3089c899b3b249519c56b2811af064caa596cfe0 /src | |
| parent | c80d2f3d67d9802f39288945758f6bb7b88fd259 (diff) | |
| download | emacs-8b90d91f2160c04a4f1efb0a5c05dd7c38ef0110.tar.gz emacs-8b90d91f2160c04a4f1efb0a5c05dd7c38ef0110.zip | |
Fix previous change in 'pop_it'
* src/xdisp.c (restore_face_box_flags): New function.
(pop_it): Use 'restore_face_box_flags'. (Bug#51550)
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 55 |
1 files changed, 23 insertions, 32 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 6c63278f528..4136079f491 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -6829,6 +6829,27 @@ iterate_out_of_display_property (struct it *it) | |||
| 6829 | it->current.string_pos = it->position; | 6829 | it->current.string_pos = it->position; |
| 6830 | } | 6830 | } |
| 6831 | 6831 | ||
| 6832 | /* Restore the IT->face_box_p flag, since it could have been | ||
| 6833 | overwritten by the face of the object that we just finished | ||
| 6834 | displaying. Also, set the IT->start_of_box_run_p flag if the | ||
| 6835 | change in faces requires that. */ | ||
| 6836 | static void | ||
| 6837 | restore_face_box_flags (struct it *it, int prev_face_id) | ||
| 6838 | { | ||
| 6839 | struct face *face = FACE_FROM_ID_OR_NULL (it->f, it->face_id); | ||
| 6840 | |||
| 6841 | if (face) | ||
| 6842 | { | ||
| 6843 | struct face *prev_face = FACE_FROM_ID_OR_NULL (it->f, prev_face_id); | ||
| 6844 | |||
| 6845 | if (!(it->start_of_box_run_p && prev_face && prev_face->box)) | ||
| 6846 | it->start_of_box_run_p = (face->box != FACE_NO_BOX | ||
| 6847 | && (prev_face == NULL | ||
| 6848 | || prev_face->box == FACE_NO_BOX)); | ||
| 6849 | it->face_box_p = face->box != FACE_NO_BOX; | ||
| 6850 | } | ||
| 6851 | } | ||
| 6852 | |||
| 6832 | /* Restore IT's settings from IT->stack. Called, for example, when no | 6853 | /* Restore IT's settings from IT->stack. Called, for example, when no |
| 6833 | more overlay strings must be processed, and we return to delivering | 6854 | more overlay strings must be processed, and we return to delivering |
| 6834 | display elements from a buffer, or when the end of a string from a | 6855 | display elements from a buffer, or when the end of a string from a |
| @@ -6873,43 +6894,13 @@ pop_it (struct it *it) | |||
| 6873 | break; | 6894 | break; |
| 6874 | case GET_FROM_BUFFER: | 6895 | case GET_FROM_BUFFER: |
| 6875 | { | 6896 | { |
| 6876 | struct face *face = FACE_FROM_ID_OR_NULL (it->f, it->face_id); | 6897 | restore_face_box_flags (it, prev_face_id); |
| 6877 | |||
| 6878 | /* Restore the face_box_p flag, since it could have been | ||
| 6879 | overwritten by the face of the object that we just finished | ||
| 6880 | displaying. Also, set the start_of_box_run_p flag if the | ||
| 6881 | change in faces requires that. */ | ||
| 6882 | if (face) | ||
| 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 | } | ||
| 6892 | it->object = it->w->contents; | 6898 | it->object = it->w->contents; |
| 6893 | } | 6899 | } |
| 6894 | break; | 6900 | break; |
| 6895 | case GET_FROM_STRING: | 6901 | case GET_FROM_STRING: |
| 6896 | { | 6902 | { |
| 6897 | struct face *face = FACE_FROM_ID_OR_NULL (it->f, it->face_id); | 6903 | restore_face_box_flags (it, prev_face_id); |
| 6898 | |||
| 6899 | /* Restore the face_box_p flag, since it could have been | ||
| 6900 | overwritten by the face of the object that we just finished | ||
| 6901 | displaying. Also, set the start_of_box_run_p flag if the | ||
| 6902 | change in faces requires that. */ | ||
| 6903 | if (face) | ||
| 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 | } | ||
| 6913 | it->object = it->string; | 6904 | it->object = it->string; |
| 6914 | } | 6905 | } |
| 6915 | break; | 6906 | break; |