summaryrefslogtreecommitdiff
path: root/src/term.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2010-01-01 06:39:56 -0500
committerEli Zaretskii <eliz@gnu.org>2010-01-01 06:39:56 -0500
commit5e65aec01a9bc5a147e492f11dd0115c98bedef4 (patch)
treee4e90662056e2320c9a6941a96b7caaf9227313a /src/term.c
parente5a2fec7b4a8c1435d74d50796259b3e4b895cd4 (diff)
downloademacs-5e65aec01a9bc5a147e492f11dd0115c98bedef4.tar.gz
emacs-5e65aec01a9bc5a147e492f11dd0115c98bedef4.tar.bz2
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.c25
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)
+ it->glyph_row->used[it->area]);
end = it->glyph_row->glyphs[1 + it->area];
+ /* If the glyph row is reversed, we need to prepend the glyph rather
+ than append it. */
+ if (it->glyph_row->reversed_p && it->area == TEXT_AREA)
+ {
+ struct glyph *g;
+ int move_by = it->pixel_width;
+
+ /* Make room for the new glyphs. */
+ if (move_by > end - glyph) /* don't overstep end of this area */
+ move_by = end - glyph;
+ for (g = glyph - 1; g >= it->glyph_row->glyphs[it->area]; g--)
+ g[move_by] = *g;
+ glyph = it->glyph_row->glyphs[it->area];
+ end = glyph + move_by;
+ }
+
+ /* BIDI Note: we put the glyphs of a "multi-pixel" character left to
+ right, even in the REVERSED_P case, since (a) all of its u.ch are
+ identical, and (b) the PADDING_P flag needs to be set for the
+ leftmost one, because we write to the terminal left-to-right. */
for (i = 0;
i < it->pixel_width && glyph < end;
++i)
@@ -1556,6 +1576,11 @@ append_glyph (it)
glyph->padding_p = i > 0;
glyph->charpos = CHARPOS (it->position);
glyph->object = it->object;
+ if (it->bidi_p)
+ {
+ glyph->resolved_level = it->bidi_it.resolved_level;
+ glyph->bidi_type = it->bidi_it.type;
+ }
++it->glyph_row->used[it->area];
++glyph;