diff options
| author | Eli Zaretskii | 2010-01-01 06:54:22 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2010-01-01 06:54:22 -0500 |
| commit | 21fce5ab3669283e27cf8ec68905ea8778a73933 (patch) | |
| tree | 9e28ed2c7f211b24e9400a54cc567e4739d3e4ad /src | |
| parent | 93ba079d4e180e94145297f1959f31115ec3a92c (diff) | |
| download | emacs-21fce5ab3669283e27cf8ec68905ea8778a73933.tar.gz emacs-21fce5ab3669283e27cf8ec68905ea8778a73933.zip | |
Retrospective commit from 2009-11-07.
More fixes for iteration near ZV.
bidi.c (bidi_paragraph_init): Don't overstep end of buffer.
Treat end of buffer as a NEUTRAL_B character.
(bidi_resolve_explicit): Don't special-case ZV when bidi_it->type
is NEUTRAL_B, since bidi_set_paragraph_end no longer sets the
new_paragraph flag.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog.bidi | 8 | ||||
| -rw-r--r-- | src/bidi.c | 12 |
2 files changed, 15 insertions, 5 deletions
diff --git a/src/ChangeLog.bidi b/src/ChangeLog.bidi index 0df409481a7..a09ce293823 100644 --- a/src/ChangeLog.bidi +++ b/src/ChangeLog.bidi | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2009-11-07 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * bidi.c (bidi_paragraph_init): Don't overstep end of buffer. | ||
| 4 | Treat end of buffer as a NEUTRAL_B character. | ||
| 5 | (bidi_resolve_explicit): Don't special-case ZV when bidi_it->type | ||
| 6 | is NEUTRAL_B, since bidi_set_paragraph_end no longer sets the | ||
| 7 | new_paragraph flag. | ||
| 8 | |||
| 1 | 2009-10-31 Eli Zaretskii <eliz@gnu.org> | 9 | 2009-10-31 Eli Zaretskii <eliz@gnu.org> |
| 2 | 10 | ||
| 3 | * xdisp.c (display_line): Always extend reversed_p rows to the end | 11 | * xdisp.c (display_line): Always extend reversed_p rows to the end |
diff --git a/src/bidi.c b/src/bidi.c index 4b239caa6f8..e8b7b2a8c56 100644 --- a/src/bidi.c +++ b/src/bidi.c | |||
| @@ -927,6 +927,12 @@ bidi_paragraph_init (bidi_dir_t dir, struct bidi_it *bidi_it) | |||
| 927 | { | 927 | { |
| 928 | if (type == NEUTRAL_B && bidi_at_paragraph_end (pos, bytepos) >= -1) | 928 | if (type == NEUTRAL_B && bidi_at_paragraph_end (pos, bytepos) >= -1) |
| 929 | break; | 929 | break; |
| 930 | if (bytepos >= ZV_BYTE) | ||
| 931 | { | ||
| 932 | /* Pretend there's a paragraph separator at end of buffer. */ | ||
| 933 | type = NEUTRAL_B; | ||
| 934 | break; | ||
| 935 | } | ||
| 930 | FETCH_CHAR_ADVANCE (ch, pos, bytepos); | 936 | FETCH_CHAR_ADVANCE (ch, pos, bytepos); |
| 931 | } | 937 | } |
| 932 | if (type == STRONG_R || type == STRONG_AL) /* P3 */ | 938 | if (type == STRONG_R || type == STRONG_AL) /* P3 */ |
| @@ -1289,11 +1295,7 @@ bidi_resolve_explicit (struct bidi_it *bidi_it) | |||
| 1289 | 1295 | ||
| 1290 | if (bidi_it->type == NEUTRAL_B) /* X8 */ | 1296 | if (bidi_it->type == NEUTRAL_B) /* X8 */ |
| 1291 | { | 1297 | { |
| 1292 | /* End of buffer does _not_ indicate a new paragraph is coming. | 1298 | bidi_set_paragraph_end (bidi_it); |
| 1293 | Otherwise, each character inserted at EOB will be processed | ||
| 1294 | as starting a new paragraph. */ | ||
| 1295 | if (bidi_it->bytepos < ZV_BYTE) | ||
| 1296 | bidi_set_paragraph_end (bidi_it); | ||
| 1297 | /* This is needed by bidi_resolve_weak below, and in L1. */ | 1299 | /* This is needed by bidi_resolve_weak below, and in L1. */ |
| 1298 | bidi_it->type_after_w1 = bidi_it->type; | 1300 | bidi_it->type_after_w1 = bidi_it->type; |
| 1299 | bidi_check_type (bidi_it->type_after_w1); | 1301 | bidi_check_type (bidi_it->type_after_w1); |