diff options
| author | Eli Zaretskii | 2010-01-01 06:39:56 -0500 |
|---|---|---|
| committer | Eli Zaretskii | 2010-01-01 06:39:56 -0500 |
| commit | 5e65aec01a9bc5a147e492f11dd0115c98bedef4 (patch) | |
| tree | e4e90662056e2320c9a6941a96b7caaf9227313a /src/term.c | |
| parent | e5a2fec7b4a8c1435d74d50796259b3e4b895cd4 (diff) | |
| download | emacs-5e65aec01a9bc5a147e492f11dd0115c98bedef4.tar.gz emacs-5e65aec01a9bc5a147e492f11dd0115c98bedef4.zip | |
Retrospective commit from 2009-10-17.
Continue working on display of R2L glyph rows. Reverse glyphs in
term.c:append_glyph rather than in extend_face_to_end_of_line.
Fix bidi iteration near BEGV and ZV.
dispextern.h (struct glyph): New members resolved_level and
bidi_type.
xdisp.c (append_glyph, append_composite_glyph)
(produce_image_glyph, append_stretch_glyph): Set them.
term.c (append_glyph): Ditto.
xdisp.c (display_line, next_element_from_buffer): Set the glyph
row's reversed_p flag if the paragraph base direction is odd.
(extend_face_to_end_of_line): Don't reverse the glyphs here.
term.c (append_glyph): Reverse glyphs here.
bidi.c (bidi_get_next_char_visually): Don't exit early when at ZV.
(bidi_paragraph_init): Don't step over a newline if at BEGV.
(bidi_paragraph_init): Handle empty buffers.
Diffstat (limited to 'src/term.c')
| -rw-r--r-- | src/term.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/term.c b/src/term.c index fda06d6b2ed..7c9e05f36b2 100644 --- a/src/term.c +++ b/src/term.c | |||
| @@ -1545,6 +1545,26 @@ append_glyph (it) | |||
| 1545 | + it->glyph_row->used[it->area]); | 1545 | + it->glyph_row->used[it->area]); |
| 1546 | end = it->glyph_row->glyphs[1 + it->area]; | 1546 | end = it->glyph_row->glyphs[1 + it->area]; |
| 1547 | 1547 | ||
| 1548 | /* If the glyph row is reversed, we need to prepend the glyph rather | ||
| 1549 | than append it. */ | ||
| 1550 | if (it->glyph_row->reversed_p && it->area == TEXT_AREA) | ||
| 1551 | { | ||
| 1552 | struct glyph *g; | ||
| 1553 | int move_by = it->pixel_width; | ||
| 1554 | |||
| 1555 | /* Make room for the new glyphs. */ | ||
| 1556 | if (move_by > end - glyph) /* don't overstep end of this area */ | ||
| 1557 | move_by = end - glyph; | ||
| 1558 | for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--) | ||
| 1559 | g[move_by] = *g; | ||
| 1560 | glyph = it->glyph_row->glyphs[it->area]; | ||
| 1561 | end = glyph + move_by; | ||
| 1562 | } | ||
| 1563 | |||
| 1564 | /* BIDI Note: we put the glyphs of a "multi-pixel" character left to | ||
| 1565 | right, even in the REVERSED_P case, since (a) all of its u.ch are | ||
| 1566 | identical, and (b) the PADDING_P flag needs to be set for the | ||
| 1567 | leftmost one, because we write to the terminal left-to-right. */ | ||
| 1548 | for (i = 0; | 1568 | for (i = 0; |
| 1549 | i < it->pixel_width && glyph < end; | 1569 | i < it->pixel_width && glyph < end; |
| 1550 | ++i) | 1570 | ++i) |
| @@ -1556,6 +1576,11 @@ append_glyph (it) | |||
| 1556 | glyph->padding_p = i > 0; | 1576 | glyph->padding_p = i > 0; |
| 1557 | glyph->charpos = CHARPOS (it->position); | 1577 | glyph->charpos = CHARPOS (it->position); |
| 1558 | glyph->object = it->object; | 1578 | glyph->object = it->object; |
| 1579 | if (it->bidi_p) | ||
| 1580 | { | ||
| 1581 | glyph->resolved_level = it->bidi_it.resolved_level; | ||
| 1582 | glyph->bidi_type = it->bidi_it.type; | ||
| 1583 | } | ||
| 1559 | 1584 | ||
| 1560 | ++it->glyph_row->used[it->area]; | 1585 | ++it->glyph_row->used[it->area]; |
| 1561 | ++glyph; | 1586 | ++glyph; |