diff options
| author | Eli Zaretskii | 2011-06-11 19:50:09 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2011-06-11 19:50:09 +0300 |
| commit | f23590ccc9bb0b6d335fb098b56ea07f4de6c91c (patch) | |
| tree | 17d0e788285060ee04a0d4277a17aef542631615 | |
| parent | 34c48e575a30f075daedda6b487c7d24181743be (diff) | |
| download | emacs-f23590ccc9bb0b6d335fb098b56ea07f4de6c91c.tar.gz emacs-f23590ccc9bb0b6d335fb098b56ea07f4de6c91c.zip | |
Fixed a bug with displaying strings padded with blanks.
src/xdisp.c (set_iterator_to_next): Advance string position
correctly when padding it with blanks.
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/xdisp.c | 15 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 3ca0241f47c..071bcb23a03 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,10 @@ | |||
| 1 | 2011-06-11 Eli Zaretskii <eliz@gnu.org> | 1 | 2011-06-11 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | * xdisp.c (set_iterator_to_next): Advance string position | ||
| 4 | correctly when padding it with blanks. | ||
| 5 | |||
| 6 | 2011-06-11 Eli Zaretskii <eliz@gnu.org> | ||
| 7 | |||
| 3 | * xdisp.c (next_element_from_buffer): Improve commentary for when | 8 | * xdisp.c (next_element_from_buffer): Improve commentary for when |
| 4 | the iterator is before prev_stop. | 9 | the iterator is before prev_stop. |
| 5 | (init_iterator): Initialize bidi_p from the default value of | 10 | (init_iterator): Initialize bidi_p from the default value of |
diff --git a/src/xdisp.c b/src/xdisp.c index efd29895ea2..7494d5c5e48 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -6305,7 +6305,12 @@ set_iterator_to_next (struct it *it, int reseat_p) | |||
| 6305 | 6305 | ||
| 6306 | case GET_FROM_C_STRING: | 6306 | case GET_FROM_C_STRING: |
| 6307 | /* Current display element of IT is from a C string. */ | 6307 | /* Current display element of IT is from a C string. */ |
| 6308 | if (!it->bidi_p) | 6308 | if (!it->bidi_p |
| 6309 | /* If the string position is beyond string_nchars, it means | ||
| 6310 | next_element_from_c_string is padding the string with | ||
| 6311 | blanks, in which case we bypass the bidi iterator, | ||
| 6312 | because it cannot deal with such virtual characters. */ | ||
| 6313 | || IT_CHARPOS (*it) >= it->string_nchars) | ||
| 6309 | { | 6314 | { |
| 6310 | IT_BYTEPOS (*it) += it->len; | 6315 | IT_BYTEPOS (*it) += it->len; |
| 6311 | IT_CHARPOS (*it) += 1; | 6316 | IT_CHARPOS (*it) += 1; |
| @@ -6428,7 +6433,13 @@ set_iterator_to_next (struct it *it, int reseat_p) | |||
| 6428 | } | 6433 | } |
| 6429 | else | 6434 | else |
| 6430 | { | 6435 | { |
| 6431 | if (!it->bidi_p) | 6436 | if (!it->bidi_p |
| 6437 | /* If the string position is beyond string_nchars, it | ||
| 6438 | means next_element_from_string is padding the string | ||
| 6439 | with blanks, in which case we bypass the bidi | ||
| 6440 | iterator, because it cannot deal with such virtual | ||
| 6441 | characters. */ | ||
| 6442 | || IT_STRING_CHARPOS (*it) >= it->string_nchars) | ||
| 6432 | { | 6443 | { |
| 6433 | IT_STRING_BYTEPOS (*it) += it->len; | 6444 | IT_STRING_BYTEPOS (*it) += it->len; |
| 6434 | IT_STRING_CHARPOS (*it) += 1; | 6445 | IT_STRING_CHARPOS (*it) += 1; |