diff options
| author | Chong Yidong | 2008-09-20 21:44:34 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-09-20 21:44:34 +0000 |
| commit | d3864ce98ccfbf64c630cea92cb4d42e06664bd1 (patch) | |
| tree | 9c4603e5c1fd0a9de6d3659da9b1dea9826e947b /src | |
| parent | a9f0145a1ea38b37b0c6c6bb1393a77013950e5d (diff) | |
| download | emacs-d3864ce98ccfbf64c630cea92cb4d42e06664bd1.tar.gz emacs-d3864ce98ccfbf64c630cea92cb4d42e06664bd1.zip | |
(get_next_display_element): Handle string display correctly when
checking for the end of a box run.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xdisp.c | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/src/xdisp.c b/src/xdisp.c index 314c29ee350..86658ea711d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -5940,14 +5940,51 @@ get_next_display_element (it) | |||
| 5940 | if (it->face_box_p | 5940 | if (it->face_box_p |
| 5941 | && it->s == NULL) | 5941 | && it->s == NULL) |
| 5942 | { | 5942 | { |
| 5943 | int face_id; | 5943 | if (it->method == GET_FROM_STRING && it->sp) |
| 5944 | struct face *face; | 5944 | { |
| 5945 | int face_id = underlying_face_id (it); | ||
| 5946 | struct face *face = FACE_FROM_ID (it->f, face_id); | ||
| 5945 | 5947 | ||
| 5946 | it->end_of_box_run_p | 5948 | if (face) |
| 5947 | = ((face_id = face_after_it_pos (it), | 5949 | { |
| 5948 | face_id != it->face_id) | 5950 | if (face->box == FACE_NO_BOX) |
| 5949 | && (face = FACE_FROM_ID (it->f, face_id), | 5951 | { |
| 5950 | face->box == FACE_NO_BOX)); | 5952 | /* If the box comes from face properties in a |
| 5953 | display string, check faces in that string. */ | ||
| 5954 | int string_face_id = face_after_it_pos (it); | ||
| 5955 | it->end_of_box_run_p | ||
| 5956 | = (FACE_FROM_ID (it->f, string_face_id)->box | ||
| 5957 | == FACE_NO_BOX); | ||
| 5958 | } | ||
| 5959 | /* Otherwise, the box comes from the underlying face. | ||
| 5960 | If this is the last string character displayed, check | ||
| 5961 | the next buffer location. */ | ||
| 5962 | else if ((IT_STRING_CHARPOS (*it) >= SCHARS (it->string) - 1) | ||
| 5963 | && (it->current.overlay_string_index | ||
| 5964 | == it->n_overlay_strings - 1)) | ||
| 5965 | { | ||
| 5966 | EMACS_INT ignore; | ||
| 5967 | int next_face_id; | ||
| 5968 | struct text_pos pos = it->current.pos; | ||
| 5969 | INC_TEXT_POS (pos, it->multibyte_p); | ||
| 5970 | |||
| 5971 | next_face_id = face_at_buffer_position | ||
| 5972 | (it->w, CHARPOS (pos), it->region_beg_charpos, | ||
| 5973 | it->region_end_charpos, &ignore, | ||
| 5974 | (IT_CHARPOS (*it) + TEXT_PROP_DISTANCE_LIMIT), 0); | ||
| 5975 | it->end_of_box_run_p | ||
| 5976 | = (FACE_FROM_ID (it->f, next_face_id)->box | ||
| 5977 | == FACE_NO_BOX); | ||
| 5978 | } | ||
| 5979 | } | ||
| 5980 | } | ||
| 5981 | else | ||
| 5982 | { | ||
| 5983 | int face_id = face_after_it_pos (it); | ||
| 5984 | it->end_of_box_run_p | ||
| 5985 | = (face_id != it->face_id | ||
| 5986 | && FACE_FROM_ID (it->f, face_id)->box == FACE_NO_BOX); | ||
| 5987 | } | ||
| 5951 | } | 5988 | } |
| 5952 | 5989 | ||
| 5953 | /* Value is 0 if end of buffer or string reached. */ | 5990 | /* Value is 0 if end of buffer or string reached. */ |